You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2017/11/15 20:58:20 UTC
[royale-compiler] 04/05: create compiler-common.jar
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/rename
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 42b5f89ef3c9671cfa7d1166c2db7733605d6672
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Nov 14 22:29:25 2017 -0800
create compiler-common.jar
---
compiler-common/build.xml | 276 ++++------------------------------------------
1 file changed, 21 insertions(+), 255 deletions(-)
diff --git a/compiler-common/build.xml b/compiler-common/build.xml
index 5269157..ecf28b1 100644
--- a/compiler-common/build.xml
+++ b/compiler-common/build.xml
@@ -41,6 +41,8 @@
<path location="${basedir}/../compiler"/>
</pathconvert>
+ <property name="sdk" value="${compiler}/lib"/>
+
<!-- Properties can be overridden locally by loading a local.properties file -->
<!-- Java 8 users probably need javadoc.params=-Xdoclint:none -->
<property file="${compiler-common}/local.properties"/>
@@ -63,261 +65,7 @@
<isset property="env.BUILD_NUMBER"/>
</condition>
- <!--
-
- MACROS
-
- -->
-
- <!--
- Defines a <jflex input="..." skeleton="..." output="..."> macro
- for using JFlex to generate a Java-based lexer from a .lex file.
- -->
- <macrodef name="jflex">
- <attribute name="input"/>
- <attribute name="skeleton" default="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/as/skeleton.default"/>
- <attribute name="output"/>
- <sequential>
- <java jar="${compiler}/lib/external/jflex.jar" fork="true">
- <arg value="-d"/>
- <arg value="@{output}"/>
- <arg value="-q"/>
- <arg value="@{input}"/>
- <arg value="--skel"/>
- <arg value="@{skeleton}"/>
- </java>
- </sequential>
- </macrodef>
-
- <!--
- Defines an <antlr2 input="..." output="..."> macro
- for using ANTLR 2 to generate a Java-based parser from a .g file.
- -->
- <macrodef name="antlr2">
- <attribute name="input"/>
- <attribute name="output"/>
- <sequential>
- <mkdir dir="@{output}"/>
- <dirname property="antlr2.dirname.@{input}" file="@{input}"/>
- <antlr target="@{input}" outputdirectory="@{output}" dir="${antlr2.dirname.@{input}}">
- <classpath>
- <pathelement path="${compiler}/lib/external/antlr.jar"/>
- </classpath>
- </antlr>
- </sequential>
- </macrodef>
-
- <!--
- Defines an <antlr3 input="..." output="..."> macro
- for using ANTLR 3 to generate a Java-based parser from a .g file.
- -->
- <macrodef name="antlr3">
- <attribute name="input"/>
- <attribute name="output"/>
- <sequential>
- <mkdir dir="@{output}"/>
- <!-- Call antlr3 on command-line because we can't update Ant library path. -->
- <java jar="${compiler}/lib/external/antlr.jar" fork="yes" failonerror="yes">
- <arg value="@{input}"/>
- <arg value="-o"/>
- <arg value="@{output}"/>
- </java>
- </sequential>
- </macrodef>
-
- <!--
- Defines an <annotate.class file="..." annotation="..."> macro
- used for inserting @SuppressWarnings(...) into generated Java classes,
- in order to keep the build warning-free.
- ANTLR and JBurg generate code that isn't warning-free in Eclipse.
- -->
- <macrodef name="annotate.class">
- <attribute name="file"/>
- <attribute name="annotation"/>
- <sequential>
- <java classname="org.apache.royale.compiler.tools.annotate.AnnotateClass" fork="false">
- <classpath>
- <path refid="classpath"/>
- <pathelement location="${compiler-common}/../compiler-build-tools/target/classes"/>
- <pathelement location="${compiler-common}/target/classes"/>
- </classpath>
- <arg value="@{file}"/>
- <arg value="@{annotation}"/>
- </java>
- </sequential>
- </macrodef>
-
- <!--
-
- GENERATION OF JAVA CODE WITH JFLEX
-
- -->
-
- <target name="set.raw.as.tokenizer.uptodate">
- <uptodate property="raw.as.tokenizer.uptodate"
- targetfile="${compiler-common}/target/generated-sources/jflex/org/apache/royale/compiler/internal/parsing/as/RawASTokenizer.java">
- <srcfiles dir="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/as">
- <include name="RawASTokenizer.lex"/>
- <include name="skeleton.royale"/>
- </srcfiles>
- </uptodate>
- </target>
-
- <target name="raw.as.tokenizer" depends="set.raw.as.tokenizer.uptodate" unless="raw.as.tokenizer.uptodate"
- description="Generates RawASTokenizer.java">
- <echo message="Generating RawASTokenizer"/>
- <jflex input="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/as/RawASTokenizer.lex"
- skeleton="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/as/skeleton.royale"
- output="${compiler-common}/target/generated-sources/jflex/org/apache/royale/compiler/internal/parsing/as"/>
- </target>
-
- <target name="set.raw.asdoc.tokenizer.uptodate">
- <uptodate property="raw.asdoc.tokenizer.uptodate"
- targetfile="${compiler-common}/target/generated-sources/jflex/org/apache/royale/compiler/internal/parsing/as/RawASDocTokenizer.java">
- <srcfiles dir="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/as">
- <include name="RawASDocTokenizer.lex"/>
- <include name="skeleton.default"/>
- </srcfiles>
- </uptodate>
- </target>
-
- <target name="raw.asdoc.tokenizer" depends="set.raw.asdoc.tokenizer.uptodate" unless="raw.asdoc.tokenizer.uptodate"
- description="Generates RawASDocTokenizer.java">
- <echo message="Generating RawASDocTokenizer"/>
- <jflex input="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/as/RawASDocTokenizer.lex"
- output="${compiler-common}/target/generated-sources/jflex/org/apache/royale/compiler/internal/parsing/as"/>
- </target>
-
- <target name="set.raw.mxml.tokenizer.uptodate">
- <uptodate property="raw.mxml.tokenizer.uptodate"
- targetfile="${compiler-common}/target/generated-sources/jflex/org/apache/royale/compiler/internal/parsing/mxml/RawMXMLTokenizer.java">
- <srcfiles dir="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/mxml">
- <include name="RawMXMLTokenizer.lex"/>
- <include name="skeleton.default"/>
- </srcfiles>
- </uptodate>
- </target>
-
- <target name="raw.mxml.tokenizer" depends="set.raw.mxml.tokenizer.uptodate" unless="raw.mxml.tokenizer.uptodate"
- description="Generates RawMXMLTokenizer.java">
- <echo message="Generating RawMXMLTokenizer"/>
- <jflex input="${compiler-common}/src/main/jflex/org/apache/royale/compiler/internal/parsing/mxml/RawMXMLTokenizer.lex"
- output="${compiler-common}/target/generated-sources/jflex/org/apache/royale/compiler/internal/parsing/mxml"/>
- </target>
-
- <target name="jflex" depends="raw.as.tokenizer, raw.asdoc.tokenizer, raw.mxml.tokenizer"
- description="Generates Java code with JFlex"/>
-
- <!--
-
- GENERATION OF JAVA CODE WITH ANTLR
-
- -->
-
- <target name="set.as.parser.uptodate">
- <uptodate property="as.parser.uptodate"
- srcfile="${compiler-common}/src/main/antlr/org/apache/royale/compiler/internal/parsing/as/ASParser.g"
- targetfile="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as/ASParser.java"/>
- </target>
-
- <target name="as.parser" depends="set.as.parser.uptodate" unless="as.parser.uptodate">
- <echo message="Generating ASParser and ASTokenTypes"/>
- <antlr2 input="${compiler-common}/src/main/antlr/org/apache/royale/compiler/internal/parsing/as/ASParser.g"
- output="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as"/>
- <annotate.class file="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as/ASParser.java"
- annotation='@SuppressWarnings("unused")'/>
- <annotate.class file="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as/ASTokenTypes.java"
- annotation='@SuppressWarnings("unused")'/>
- </target>
-
- <target name="set.metadata.parser.uptodate">
- <uptodate property="metadata.parser.uptodate"
- targetfile="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as/MetadataParser.java">
- <srcfiles dir="${compiler-common}/src/main/antlr/org/apache/royale/compiler/internal/parsing/as">
- <include name="MetadataParser.g"/>
- <include name="ImportMetadataTokenTypes.txt"/>
- </srcfiles>
- </uptodate>
- </target>
-
- <target name="metadata.parser" depends="set.metadata.parser.uptodate" unless="metadata.parser.uptodate">
- <echo message="Generating MetadataParser and MetadataTokenTypes"/>
- <antlr2 input="${compiler-common}/src/main/antlr/org/apache/royale/compiler/internal/parsing/as/MetadataParser.g"
- output="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as"/>
- <annotate.class file="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as/MetadataParser.java"
- annotation='@SuppressWarnings("all")'/>
- <annotate.class file="${compiler-common}/target/generated-sources/antlr/org/apache/royale/compiler/internal/parsing/as/MetadataTokenTypes.java"
- annotation='@SuppressWarnings("unused")'/>
- </target>
-
- <target name="set.css.lexer.and.parser.uptodate">
- <uptodate property="css.lexer.and.parser.uptodate"
- srcfile="${compiler-common}/src/main/antlr/org/apache/royale/compiler/internal/css/CSS.g"
- targetfile="${compiler-common}/target/generated-sources/java/org/apache/royale/compiler/internal/css/CSSParser.java"/>
- </target>
-
- <target name="css.lexer.and.parser" depends="set.css.lexer.and.parser.uptodate" unless="css.lexer.and.parser.uptodate">
- <echo message="Generating CSSLexer and CSSParser"/>
- <antlr3 input="${compiler-common}/src/main/antlr3/org/apache/royale/compiler/internal/css/CSS.g"
- output="${compiler-common}/target/generated-sources/antlr3/org/apache/royale/compiler/internal/css"/>
- <!--<annotate.class file="${compiler-common}/generated/src/org/apache/royale/compiler/internal/css/CSSLexer.java"
- annotation='@SuppressWarnings("unused")'/>-->
- <!--<annotate.class file="${compiler-common}/generated/src/org/apache/royale/compiler/internal/css/CSSParser.java"
- annotation='@SuppressWarnings("unused")'/>-->
- </target>
-
- <target name="set.css.tree.uptodate">
- <uptodate property="css.tree.uptodate"
- srcfile="${compiler-common}/src/main/antlr3/org/apache/royale/compiler/internal/css/CSSTree.g"
- targetfile="${compiler-common}/target/generated-sources/antlr3/org/apache/royale/compiler/internal/css/CSSTree.java"/>
- </target>
-
- <target name="css.tree" depends="set.css.tree.uptodate" unless="css.tree.uptodate">
- <echo message="Generating CSSTree"/>
- <antlr3 input="${compiler-common}/src/main/antlr3/org/apache/royale/compiler/internal/css/CSSTree.g"
- output="${compiler-common}/target/generated-sources/antlr3/org/apache/royale/compiler/internal/css"/>
- <!--<annotate.class file="${compiler-common}/generated/src/org/apache/royale/compiler/internal/css/CSSTree.java"
- annotation='@SuppressWarnings({"rawtypes", "unchecked", "unused"})'/>-->
- </target>
-
- <target name="antlr" depends="as.parser, metadata.parser, css.lexer.and.parser, css.tree"
- description="Generates Java code with ANTLR"/>
-
- <!--
- <target name="compiler.test.downloads.cache" if="usingDownloadCache">
- <ant antfile="${compiler-common}/../compiler/src/test/downloads.xml" dir="${compiler-common}/../compiler/src/test" inheritAll="false">
- <property name="usingDownloadCache" value="${usingDownloadCache}" />
- <property name="downloadCacheFolder" value="${downloadCacheFolder}" />
- </ant>
- </target>
- <target name="compiler.test.downloads" depends="compiler.test.downloads.cache" unless="usingDownloadCache">
- <ant antfile="${compiler-common}/../compiler/src/test/downloads.xml" dir="${compiler-common}/../compiler/src/test" inheritAll="false"/>
- </target>
- -->
-
- <!--
-
- EXTERNC
-
- -->
-
- <!--
- <target name="test.classes" depends="compiler.test.downloads">
- <mkdir dir="${compiler-common}/target/classes"/>
- <javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler-common}/target/classes" includeAntRuntime="true"
- source="${javac.src}" target="${javac.src}">
- <compilerarg value="-Xlint:all,-path,-fallthrough"/>
- <src path="${compiler-common}/src/main/java"/>
- <include name="org/apache/royale/utils/*.java"/>
- <classpath>
- <pathelement location="${compiler-common}/target/classes"/>
- <fileset dir="${compiler}/lib/external" includes="**/*.jar"/>
- </classpath>
- </javac>
- </target>
- -->
-
- <target name="main" > <!-- depends="jflex, antlr" >-->
+ <target name="compile" >
<mkdir dir="${compiler-common}/target/classes"/>
<javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler-common}/target/classes" includeAntRuntime="true" includes="**/*.java"
source="${javac.src}" target="${javac.src}">
@@ -335,6 +83,24 @@
</javac>
</target>
+ <target name="main" depends="compile" >
+ <mkdir dir="${sdk}"/>
+ <copy file="${basedir}/../LICENSE.base" tofile="${compiler-common}/target/classes/META-INF/LICENSE"/>
+ <copy file="${basedir}/../NOTICE.base" tofile="${compiler-common}/target/classes/META-INF/NOTICE"/>
+ <jar file="${sdk}/compiler-common.jar" basedir="${compiler-common}/target/classes" includes="**/*.properties,org/apache/**/*,META-INF/**/*">
+ <include name="META-INF/LICENSE"/>
+ <include name="META-INF/NOTICE"/>
+ <manifest>
+ <attribute name="Sealed" value="${manifest.sealed}"/>
+ <attribute name="Implementation-Title" value="${manifest.Implementation-Title}"/>
+ <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
+ <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
+ <attribute name="Class-Path" value="external/commons-cli.jar external/commons-io.jar external/guava.jar .."/>
+ <!-- The .. in the line above allows the compiler to load the env.properties file -->
+ </manifest>
+ </jar>
+ </target>
+
<!--
CLEANUP
--
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.