diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-11-05 00:05:14 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-11-05 00:05:14 -0500 |
commit | 486506827661f63002aea56f9b0e5fee10f11404 (patch) | |
tree | 1fe2d2373dde8cbab56f447563b90046ff368672 /libre | |
parent | 9ca51be9bd756348cbb45d827f97eb3d2b017280 (diff) |
closure-compiler: updating version
Diffstat (limited to 'libre')
-rw-r--r-- | libre/closure-compiler/PKGBUILD | 70 | ||||
-rw-r--r-- | libre/closure-compiler/build.xml | 320 | ||||
-rw-r--r-- | libre/closure-compiler/closure-compiler-fix_build.patch | 23 |
3 files changed, 344 insertions, 69 deletions
diff --git a/libre/closure-compiler/PKGBUILD b/libre/closure-compiler/PKGBUILD index a0694b260..a10cab359 100644 --- a/libre/closure-compiler/PKGBUILD +++ b/libre/closure-compiler/PKGBUILD @@ -2,33 +2,21 @@ # Contributor: Omar Vega Ramos <ovruni@gnu.org.pe> pkgname=closure-compiler -pkgver=20160713 +pkgver=20161024 pkgrel=1.parabola1 pkgdesc="Performs checking, instrumentation and optimizations on Javascript code." arch=('any') url="https://developers.google.com/closure/compiler/" license=('APACHE') depends=('java-runtime') -makedepends=( - 'apache-ant' - 'args4j' - 'java-guava' - #'java-jarjar' - 'java-gson' - 'jsr305' - 'junit' - 'protobuf-java' - #'java-mockito-core' # does not exist - #'objenesis' # does not exist - 'jh' -) - +makedepends=('apache-ant' 'args4j' 'java-gson' 'java-guava' 'jsr305' 'protobuf-java' 'jh') source=("https://repo.parabola.nu/other/$pkgname/$pkgname-$pkgver.tar.gz" - 'closure-compiler.sh' - 'closure-compiler-fix_build.patch') -sha256sums=('23bf36c418e41eaef9e7375ef6a27fbc0f52a52bd3c8375e949c8f7b23ca5c0c' - '10b0d74a305548b029f05bd4fb0ffabec2ff782f9e3c054c2f5236f1bf4c6630' - '214582d37ec2adeae4dd14bd12ac715a2d9cb0e48b66ad8567bd3dda1dca29a4') + "https://repo1.maven.org/maven2/com/google/jsinterop/jsinterop-annotations/1.0.1/jsinterop-annotations-1.0.1-sources.jar" + 'build.xml' 'closure-compiler.sh') +sha256sums=('4aab6ad08ff83f05226312199bd39be128d57afa62789252d9facab6260efc65' + '082d7a7cba06f0543b7d0085929897f343054acd8491a4d7020ab433d4f6daf5' + '7b3db592705a140dde6c60b61ed6de1f36be43389327aad132461cc36f1759b4' + '10b0d74a305548b029f05bd4fb0ffabec2ff782f9e3c054c2f5236f1bf4c6630') mkdepends=(git) mksource=("$pkgname-$pkgver::git+https://github.com/google/closure-compiler.git#tag=v$pkgver") @@ -36,17 +24,8 @@ mkmd5sums=('SKIP') mksource() { cd "$srcdir/$pkgname-$pkgver" - rm -rv lib/*.jar - - sed -i " - /<target name=\"relversion\">/,/<\/target>/ { - s/executable=\"git\"/executable=\"echo\"/ - /<arg/d - /<\/exec>/i<arg value=\"v$pkgver\" /> - }" \ - build.xml - sed -i "s/1\.0-SNAPSHOT/v$pkgver/g" \ + sed -i "s/1.0-SNAPSHOT/v$pkgver/g" \ externs/pom.xml \ pom.xml \ pom-main.xml @@ -55,23 +34,24 @@ mksource() { prepare() { cd "$srcdir/$pkgname-$pkgver" - ln -sf /usr/share/apache-ant/lib/ant.jar lib/ant.jar - ln -sf /usr/share/apache-ant/lib/ant-launcher.jar lib/ant-launcher.jar + mv ../build.xml . + sed -i "s/1.0-SNAPSHOT/v$pkgver/g" build.xml + + mkdir -p {jsinterop,lib} + ln -sf /usr/share/apache-ant/lib/ant.jar lib/ant.jar ln -sf /usr/share/java/args4j.jar lib/args4j.jar ln -sf /usr/share/java/guava.jar lib/guava.jar - #ln -sf /usr/share/java/jarjar.jar lib/jarjar.jar ln -sf /usr/share/java/gson.jar lib/gson.jar ln -sf /usr/share/java/jsr305.jar lib/jsr305.jar - ln -sf /usr/share/java/junit.jar lib/junit.jar - #ln -sf /usr/share/java/mockito-core.jar lib/mockito-core.jar - #ln -sf /usr/share/java/objenesis.jar lib/objenesis.jar ln -sf /usr/share/java/protobuf.jar lib/protobuf-java.jar - - patch -Np1 -i "$srcdir/closure-compiler-fix_build.patch" } build() { cd "$srcdir/$pkgname-$pkgver" + + javac -d jsinterop $(find ../jsinterop/ -name \*.java) + jar -cvf lib/jsinterop.jar -C jsinterop . + ant jar javadoc } @@ -83,19 +63,17 @@ package() { # Install documentation install -d "$pkgdir/usr/share/doc/$pkgname" - cp -r "build/javadoc" "$pkgdir/usr/share/doc/$pkgname" + cp -r build/javadoc "$pkgdir/usr/share/doc/$pkgname" # Install Maven artifacts - export DESTDIR="$pkgdir" + export DESTDIR=$pkgdir jh mvn-install com.google.javascript "$pkgname-parent" "v$pkgver" pom.xml jh mvn-install com.google.javascript "$pkgname-externs" "v$pkgver" externs/pom.xml jh mvn-install com.google.javascript "$pkgname" "v$pkgver" pom-main.xml \ - build/compiler.jar "$pkgname-$pkgver.jar" - ln -s "/usr/share/java/$pkgname-$pkgver.jar" \ - "$pkgdir/usr/share/java/$pkgname.jar" + build/compiler.jar "$pkgname.jar" - install -Dm755 "$srcdir/closure-compiler.sh" "$pkgdir/usr/bin/closure-compiler" + ln -s "/usr/share/java/$pkgname.jar" \ + "$pkgdir/usr/share/java/$pkgname-$pkgver.jar" - # symlink for compatibility with Arch's [community]/closure-compiler - ln -s closure-compiler "$pkgdir/usr/bin/closure" + install -Dm755 "$srcdir/closure-compiler.sh" "$pkgdir/usr/bin/closure-compiler" } diff --git a/libre/closure-compiler/build.xml b/libre/closure-compiler/build.xml new file mode 100644 index 000000000..9c351ad10 --- /dev/null +++ b/libre/closure-compiler/build.xml @@ -0,0 +1,320 @@ +<!-- + Copyright 2009 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project name="compiler" basedir="." default="jar"> + + <!-- + Use -Dtest.class to change what tests are run on the command-line. + i.e., -Dtest.class=CommandLineRunnerTest will run just that test class. + --> + <property name="test.class" value="*Test"/> + + <!-- Use -Dtest.method in conjunction with the one-test rule. --> + <property name="test.method" value=""/> + + <!-- + Use -Dtest.fork to specify whether or not to fork the process. + Some machines run better with forking turned off. + --> + <property name="test.fork" value="true"/> + + <!-- Force java 7 --> + <property name="ant.build.javac.source" value="1.7" /> + <property name="ant.build.javac.target" value="1.7" /> + + <!-- define other variables --> + <property name="javac.debug" value="on" /> + <property name="src.dir" value="${basedir}/src" /> + <property name="gen.dir" value="${basedir}/gen" /> + <property name="test.dir" value="${basedir}/test" /> + <property name="externs.dir" value="${basedir}/externs" /> + <!-- To workaround Ant limitation on overriding properties set on the + command-line, define a unique property to allow "build.dir" to + be change without forcing the build of Rhino to the same directory. + --> + <property name="closure.build.dir" value="${basedir}/build" /> + <property name="build.dir" value="${closure.build.dir}" /> + <property name="buildlib.dir" value="${build.dir}/lib" /> + <property name="classes.dir" value="${build.dir}/classes" /> + <property name="testClasses.dir" value="${build.dir}/test" /> + <property name="javadoc.dir" value="${build.dir}/javadoc" /> + <property name="lib.dir" value="${basedir}/lib" /> + <property name="tools.dir" value="${basedir}/tools" /> + <property name="compiler-jarfile" + value="${build.dir}/${ant.project.name}.jar" /> + <property name="linter-jarfile" + value="${build.dir}/linter.jar" /> + + <!-- The following server is used to deploy releases to maven central via Sonatypes + publishing service which runs on oss.sonatype.org. + + You will need to have an account on sonatype.org to push releases. You can + override these values if you want to deploy to a different repository + --> + <property name="maven-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" /> + <property name="maven-repository-id" value="sonatype-nexus-staging" /> + + <!-- proto compiler used to generate java classes from .proto files --> + <property name="protoc.executable" value="protoc"/> + + <property file="build.properties" /> + + <!-- gather release version --> + <target name="relversion"> + <exec outputproperty="build.relVersion" + executable="echo" + failonerror="false" + failifexecutionfails="false" + dir="."> + <arg value="1.0-SNAPSHOT" /> + </exec> + </target> + + <target name="protobuf-gen"> + <fileset dir="${src.dir}" id="proto.classpath"> + <include name="**/*.proto"/> + </fileset> + <pathconvert property="protofiles" pathsep=" " refid="proto.classpath"/> + <echo message="${protoc.executable} -I ${src.dir} --java_out=${gen.dir} ${protofiles}"/> + <exec executable="${protoc.executable}" searchpath="true"> + <arg line="-I ${src.dir}"/> + <arg line="--java_out=${gen.dir}"/> + <arg line="${protofiles}"/> + </exec> + </target> + + <!-- set the classpath for the project --> + <!-- this includes the generated source class files --> + <!-- and every jar in the /lib directory --> + + <path id="srcclasspath.path"> + <pathelement location="${classes.dir}" /> + <fileset dir="${lib.dir}"> + <include name="args4j.jar"/> + <include name="guava.jar"/> + <include name="gson.jar"/> + <include name="jsinterop.jar"/> + <include name="jsr305.jar"/> + <include name="protobuf-java.jar"/> + </fileset> + </path> + + <path id="allclasspath.path"> + <pathelement location="${classes.dir}" /> + <fileset dir="${lib.dir}"> + <include name="*.jar"/> + </fileset> + </path> + + <target name="clean" description="delete generated files"> + <delete dir="${build.dir}" /> + </target> + + <target name="compile" + description="compile the source code" + depends="relversion"> + <mkdir dir="${classes.dir}" /> + <javac srcdir="${gen.dir}" + destdir="${classes.dir}" + debug="${javac.debug}" + deprecation="on" + includeantruntime="false" + encoding="utf-8"> + <classpath refid="srcclasspath.path" /> + <compilerarg value="-Xlint:unchecked"/> + </javac> + <javac srcdir="${src.dir}" + destdir="${classes.dir}" + excludes="**/debugger/**,**/gwt/**,**/super/**,**/refactoring/**,**/testing/**,**/webservice/**" + debug="${javac.debug}" + deprecation="on" + includeantruntime="true" + encoding="utf-8"> + <classpath refid="srcclasspath.path" /> + <compilerarg value="-Xlint:unchecked"/> + </javac> + + <!-- Move Messages.properties where ScriptRuntime.java expects it. --> + <copy file="${src.dir}/com/google/javascript/rhino/Messages.properties" + todir="${classes.dir}/com/google/javascript/rhino/" /> + + <!-- Move ParserConfig.properties where ParserRunner.java expects it. --> + <copy file="${src.dir}/com/google/javascript/jscomp/parsing/ParserConfig.properties" + todir="${classes.dir}/com/google/javascript/jscomp/parsing" /> + + <propertyfile + file="${classes.dir}/com/google/javascript/jscomp/parsing/ParserConfig.properties" + comment="Parser properties"> + <entry key="compiler.date" type="date" value="now"/> + <entry key="compiler.version" value="${build.relVersion}"/> + </propertyfile> + + <!-- Move the runtime libraries where the compiler expects them. --> + <mkdir dir="${classes.dir}/com/google/javascript/jscomp/js" /> + <copy todir="${classes.dir}/com/google/javascript/jscomp/js"> + <fileset dir="${src.dir}/com/google/javascript/jscomp/js" /> + </copy> + + <!-- Zip the externs and move them to the classes folder --> + <zip destfile="${classes.dir}/externs.zip" basedir="${externs.dir}" includes="**/*.js" /> + </target> + + <target name="jar" + depends="compile" + description="package compiler as an executable jar"> + <jar destfile="${compiler-jarfile}" update="true"> + <fileset dir="${classes.dir}" /> + <zipfileset src="${lib.dir}/args4j.jar"/> + <zipfileset src="${lib.dir}/guava.jar"/> + <zipfileset src="${lib.dir}/gson.jar"/> + <zipfileset src="${lib.dir}/jsr305.jar"/> + <zipfileset src="${lib.dir}/protobuf-java.jar"/> + + <manifest> + <attribute name="Main-Class" + value="com.google.javascript.jscomp.CommandLineRunner" /> + </manifest> + </jar> + </target> + + <target name="linter" + depends="compile" + description="package linter as an executable jar"> + <jar destfile="${linter-jarfile}" update="true"> + <fileset dir="${classes.dir}" /> + <zipfileset src="${lib.dir}/args4j.jar"/> + <zipfileset src="${lib.dir}/guava.jar"/> + <zipfileset src="${lib.dir}/gson.jar"/> + <zipfileset src="${lib.dir}/jsr305.jar"/> + <zipfileset src="${lib.dir}/protobuf-java.jar"/> + + <manifest> + <attribute name="Main-Class" + value="com.google.javascript.jscomp.Linter" /> + </manifest> + </jar> + </target> + + <target name="compile-tests" + depends="compile" + description="compile the JUnit tests"> + <mkdir dir="${testClasses.dir}" /> + <javac srcdir="${src.dir}" + destdir="${testClasses.dir}" + excludes="**/debugger/**,**/gwt/**,**/super/**" + debug="on" + deprecation="on" + includeantruntime="false" + encoding="utf-8"> + <classpath refid="allclasspath.path" /> + <compilerarg value="-Xlint:unchecked"/> + </javac> + <javac srcdir="${test.dir}" + destdir="${testClasses.dir}" + excludes=".svn,.git,**/debugger/**,**/gwt/**" + debug="on" + deprecation="on" + includeantruntime="false" + encoding="utf-8"> + <classpath refid="allclasspath.path" /> + <compilerarg value="-Xlint:unchecked"/> + </javac> + </target> + + <target name="all-classes-jar" + depends="compile,compile-tests" + description="package the compiler and its tests into one jar"> + <jar destfile="${compiler-jarfile}" update="true"> + <fileset dir="${testClasses.dir}" /> + <zipgroupfileset dir="${lib.dir}" includes="*.jar"/> + </jar> + </target> + + <target name="test" + depends="compile-tests" + description="Compile and execute the JUnit tests."> + <mkdir dir="build/testoutput"/> + <junit printsummary="on" fork="${test.fork}" + forkmode="once" showoutput="true" + dir="${basedir}" + failureproperty="junit.failure"> + <classpath refid="allclasspath.path" /> + <classpath> + <pathelement location="${build.dir}/test" /> + </classpath> + <batchtest todir="build/testoutput"> + <formatter type="brief" usefile="false" /> + <formatter type="xml" /> + <fileset dir="${build.dir}/test"> + <include name="**/${test.class}.class" /> + </fileset> + </batchtest> + </junit> + <junitreport> + <fileset dir="build/testoutput" includes="*.xml"/> + <report todir="build/testoutput"/> + </junitreport> + <fail if="junit.failure" + message="Unit tests failed. See build/testoutput/index.html" /> + </target> + + <target name="one-test" + depends="compile-tests" + description="Compile and execute one JUnit test + specified with -Dtest.class and -Dtest.method."> + <mkdir dir="build/testoutput"/> + <junit printsummary="on" fork="${test.fork}" + forkmode="once" showoutput="true" + dir="${basedir}" + failureproperty="junit.failure"> + <classpath refid="allclasspath.path" /> + <classpath> + <pathelement location="${build.dir}/test" /> + </classpath> + <test todir="build/testoutput" name="${test.class}" methods="${test.method}"> + <formatter type="brief" usefile="false" /> + <formatter type="xml" /> + </test> + </junit> + <junitreport> + <fileset dir="build/testoutput" includes="*.xml"/> + <report todir="build/testoutput"/> + </junitreport> + <fail if="junit.failure" + message="Unit tests failed. See build/testoutput/index.html" /> + </target> + + <target name="javadoc" + description="generate Javadoc"> + <mkdir dir="${javadoc.dir}" /> + <javadoc + destdir="${javadoc.dir}" + author="false" + protected="true" + windowtitle="Closure Compiler" + additionalparam=" -notimestamp " + encoding="utf-8"> + <fileset dir="${basedir}" defaultexcludes="yes"> + <include name="src/**/*.java"/> + <include name="gen/**/*.java"/> + <exclude name="**/debugger/**"/> + <exclude name="**/gwt/**"/> + <exclude name="**/super/**"/> + <exclude name="**/testing/**"/> + </fileset> + <classpath refid="allclasspath.path" /> + </javadoc> + </target> +</project> diff --git a/libre/closure-compiler/closure-compiler-fix_build.patch b/libre/closure-compiler/closure-compiler-fix_build.patch deleted file mode 100644 index 557e3b51a..000000000 --- a/libre/closure-compiler/closure-compiler-fix_build.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- closure-compiler-20160619.orig/build.xml 2016-07-04 19:47:30.000000000 -0500 -+++ closure-compiler-20160619/build.xml 2016-07-05 00:36:28.456947257 -0500 -@@ -312,11 +312,15 @@ - author="false" - protected="true" - windowtitle="Closure Compiler" -- additionalparam=" -notimestamp "> -- <sourcepath> -- <pathelement location="${src.dir}" /> -- <pathelement location="${gen.dir}" /> -- </sourcepath> -+ additionalparam=" -notimestamp " -+ encoding="utf-8"> -+ <fileset dir="${basedir}" defaultexcludes="yes"> -+ <include name="src/**/*.java"/> -+ <include name="gen/**/*.java"/> -+ <exclude name="**/gwt/**"/> -+ <exclude name="**/debugger/**"/> -+ <exclude name="**/testing/**"/> -+ </fileset> - <classpath refid="allclasspath.path" /> - <link href="http://docs.oracle.com/javase/7/docs/api/" /> - </javadoc> |