This is an automated email from the ASF dual-hosted git repository. jensg pushed a commit to branch 0.12.1 in repository https://gitbox.apache.org/repos/asf/thrift.git
commit f30648f86c740fe36d6b69dbb6af216c0f66bd06 Author: James E. King III <[email protected]> AuthorDate: Tue Jan 22 14:16:39 2019 -0500 THRIFT-4750: as3 changes to build and publish to maven central --- .gitignore | 2 + build/docker/ubuntu-bionic/Dockerfile | 8 + configure.ac | 29 ++++ lib/Makefile.am | 4 + lib/as3/Makefile.am | 53 +++++++ lib/as3/README.md | 37 +++++ lib/{java => as3}/build.gradle | 41 ++--- lib/as3/build.properties | 5 - lib/as3/build.xml | 182 ----------------------- lib/{java => as3}/gradle.properties | 22 +-- lib/as3/gradle/publishing.gradle | 96 ++++++++++++ lib/as3/gradle/wrapper/gradle-wrapper.properties | 5 + lib/as3/gradlew | 172 +++++++++++++++++++++ lib/as3/gradlew.bat | 84 +++++++++++ lib/as3/settings.gradle | 20 +++ lib/java/build.gradle | 1 - lib/java/gradle.properties | 10 -- 17 files changed, 527 insertions(+), 244 deletions(-) diff --git a/.gitignore b/.gitignore index b7f7b45..4873d98 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,8 @@ project.lock.json /contrib/fb303/py/fb303/ttypes.py /depcomp /install-sh +/lib/as3/.gradle/ +/lib/as3/build/ /lib/cl/backport-update.zip /lib/cl/lib /lib/cl/run-tests diff --git a/build/docker/ubuntu-bionic/Dockerfile b/build/docker/ubuntu-bionic/Dockerfile index a8c1417..aef35c5 100644 --- a/build/docker/ubuntu-bionic/Dockerfile +++ b/build/docker/ubuntu-bionic/Dockerfile @@ -72,10 +72,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ llvm \ ninja-build \ pkg-config \ + unzip \ valgrind \ vim ENV PATH /usr/lib/llvm-6.0/bin:$PATH +# lib/as3 (ActionScript) +RUN mkdir -p /usr/local/adobe/flex/4.6 && \ + cd /usr/local/adobe/flex/4.6 && \ + wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \ + unzip flex_sdk_4.6.zip +ENV FLEX_HOME /usr/local/adobe/flex/4.6 + RUN apt-get install -y --no-install-recommends \ `# C++ dependencies` \ libboost-all-dev \ diff --git a/configure.ac b/configure.ac index ef5663b..bcda1e0 100755 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,7 @@ AC_ARG_ENABLE([libs], have_libs=yes if test "$enable_libs" = "no"; then have_libs="no" + with_as3="no" with_cpp="no" with_c_glib="no" with_cl="no" @@ -143,6 +144,18 @@ if test "$enable_libs" = "no"; then with_rs="no" fi +AX_THRIFT_LIB(as3, [as3], yes) +have_as3=no +if test "$with_as3" = "yes"; then + if test "${FLEX_HOME+set}" = set; then + AC_PATH_PROGS([FLEX_COMPC], [compc], "fail", [$PATH$PATH_SEPARATOR$FLEX_HOME/bin]) + if test "$FLEX_COMPC" != "fail"; then + have_as3="yes" + fi + fi +fi +AM_CONDITIONAL(WITH_AS3, [test "$have_as3" = "yes"]) + AX_THRIFT_LIB(cpp, [C++], yes) have_cpp=no if test "$with_cpp" = "yes"; then @@ -202,6 +215,7 @@ if test "$with_c_glib" = "yes"; then PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0], have_glib2=yes, have_glib2=no) PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.0], have_gobject2=yes, have_gobject2=no) if test "$have_glib2" = "yes" -a "$have_gobject2" = "yes" ; then + AC_PATH_PROG([GSETTINGS], [gsettings]) have_c_glib="yes" fi fi @@ -813,6 +827,7 @@ AC_CONFIG_FILES([ compiler/cpp/test/Makefile compiler/cpp/src/thrift/version.h lib/Makefile + lib/as3/Makefile lib/cl/Makefile lib/cpp/Makefile lib/cpp/test/Makefile @@ -893,6 +908,8 @@ AC_CONFIG_FILES([ tutorial/rs/Makefile ]) +if test "$have_as3" = "yes" ; then MAYBE_AS3="as3" ; else MAYBE_AS3="" ; fi +AC_SUBST([MAYBE_AS3]) if test "$have_cpp" = "yes" ; then MAYBE_CPP="cpp" ; else MAYBE_CPP="" ; fi AC_SUBST([MAYBE_CPP]) if test "$have_c_glib" = "yes" ; then MAYBE_C_GLIB="c_glib" ; else MAYBE_C_GLIB="" ; fi @@ -940,6 +957,7 @@ AC_OUTPUT echo echo "$PACKAGE $VERSION" echo +echo "Building ActionScript3 Library : $have_as3" echo "Building C (GLib) Library .... : $have_c_glib" echo "Building C# (Mono) Library ... : $have_csharp" echo "Building C++ Library ......... : $have_cpp" @@ -962,6 +980,17 @@ echo "Building Py3 Library ......... : $have_py3" echo "Building Ruby Library ........ : $have_ruby" echo "Building Rust Library ........ : $have_rs" +if test "$have_as3" = "yes" ; then + echo + echo "ActionScript Library:" + echo " FLEX_HOME ................. : $FLEX_HOME" + echo " Using compc version ....... : $($FLEX_COMPC --version)" +fi +if test "$have_c_glib" = "yes" ; then + echo + echo "C (glib):" + echo " Using glib version ........ : $($GSETTINGS --version)" +fi if test "$have_csharp" = "yes" ; then echo echo "C# Library:" diff --git a/lib/Makefile.am b/lib/Makefile.am index b315609..1a9177a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -20,6 +20,10 @@ SUBDIRS = json xml PRECROSS_TARGET = +if WITH_AS3 +SUBDIRS += as3 +endif + if WITH_CPP # cpp dir is picked directly by plugin build if !WITH_PLUGIN diff --git a/lib/as3/Makefile.am b/lib/as3/Makefile.am new file mode 100644 index 0000000..f06c239 --- /dev/null +++ b/lib/as3/Makefile.am @@ -0,0 +1,53 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +all-local: + ./gradlew $(GRADLE_OPTS) compile \ + -Prelease=true \ + --console=plain + +install-exec-hook: + ./gradlew $(GRADLE_OPTS) publishToMavenLocal \ + -Prelease=true \ + --console=plain + +clean-local: + ./gradlew $(GRADLE_OPTS) clean \ + -Prelease=true \ + --console=plain + +check-local: $(THRIFT) + ./gradlew $(GRADLE_OPTS) test \ + -Prelease=true \ + --console=plain + +maven-publish: + ./gradlew $(GRADLE_OPTS) publishMavenPublicationToMavenRepository \ + -Prelease=true \ + -Psign=true \ + --console=plain + +EXTRA_DIST = \ + build.gradle \ + gradle.properties \ + gradle/ \ + gradlew \ + gradlew.bat \ + settings.gradle \ + src/ diff --git a/lib/as3/README.md b/lib/as3/README.md new file mode 100644 index 0000000..c14f8c7 --- /dev/null +++ b/lib/as3/README.md @@ -0,0 +1,37 @@ +# Apache Thrift ActionScript Library + +## Building + +We use gradle and gradlefx to build the as3 library. Unfortunately gradlefx requires +an older version of gradle (2.5) but it still works - for now. If you use the docker +container to do the build, the Adobe Flex SDK 4.6 is installed and the FLEX_HOME +environment variable is configured: + + dev@ubuntu:~/thrift$ docker run -v $(pwd):/thrift/src:rw -it thrift/thrift-build:ubuntu-bionic /bin/bash + root@7624b61bbf84:/thrift/src# cd lib/as3 + root@7624b61bbf84:/thrift/src/lib/as3# ./gradlew -Prelease=true compileFlex + + ... + + :compileFlex UP-TO-DATE + + BUILD SUCCESSFUL + + Total time: 10.784 secs + + root@7624b61bbf84:/thrift/src/lib/as3# ls -ls build/ + total 4 + 4 -rw-r--r-- 1 root root 1379 Jan 22 19:23 libthrift-as3.swc + +## Publishing + +We use a similar gradle-based signing and publishing mechanism as in the java +library. See the java library [README.md](../java/README.md) for more details. + +To publish into a local .m2 repository you can mount a directory into the docker container, +for example: + + dev@ubuntu:~/thrift$ docker run -v~/.m2:/root/.m2 -v $(pwd):/thrift/src:rw -it thrift/thrift-build:ubuntu-bionic /bin/bash + root@7624b61bbf84:/thrift/src/lib/as3# ./gradlew -Prelease=true publishToMavenLocal + +You will find your `~/.m2` directory is now populated with a release build `swc`. diff --git a/lib/java/build.gradle b/lib/as3/build.gradle similarity index 53% copy from lib/java/build.gradle copy to lib/as3/build.gradle index 6dd35e4..7853499 100644 --- a/lib/java/build.gradle +++ b/lib/as3/build.gradle @@ -17,49 +17,40 @@ * under the License. */ -// Using the legacy plugin classpath for Clover so it can be loaded optionally buildscript { repositories { + mavenLocal() mavenCentral() - google() - jcenter() - gradlePluginPortal() } - dependencies { - classpath 'com.bmuschko:gradle-clover-plugin:2.2.0' + classpath group: 'org.gradlefx', name: 'gradlefx', version: '1.5.0' } } plugins { - id 'java' - id 'maven' + id 'maven-publish' id 'signing' - id 'com.github.johnrengelman.shadow' version '2.0.2' } -description = 'Apache Thrift Java Library' - -defaultTasks 'build' +apply plugin: 'gradlefx' -// Version components for this project +description = 'Apache Thrift ActionScript Library' +frameworkLinkage = 'none' group = property('thrift.groupid') +srcDirs = ['src'] +type = 'swc' -// Drop the -dev suffix, we use the SNAPSHOT suffix for non-release versions -def parsedVersion = property('thrift.version').toString().replace('-dev', '') +// We use the SNAPSHOT suffix for non-release versions if (Boolean.parseBoolean(project.release)) { - version = parsedVersion + additionalCompilerOptions = ['-compiler.debug=false', '-compiler.strict=true'] + version = property('thrift.version') } else { - version = parsedVersion + '-SNAPSHOT' + additionalCompilerOptions = ['-compiler.debug=true', '-compiler.strict=true'] + version = property('thrift.version') + '-SNAPSHOT' } +defaultTasks 'compile' + // Keeping the rest of the build logic in functional named scripts for clarity -apply from: 'gradle/environment.gradle' -apply from: 'gradle/sourceConfiguration.gradle' -apply from: 'gradle/additionalArtifacts.gradle' -apply from: 'gradle/generateTestThrift.gradle' -apply from: 'gradle/unitTests.gradle' -apply from: 'gradle/cloverCoverage.gradle' -apply from: 'gradle/functionalTests.gradle' apply from: 'gradle/publishing.gradle' -apply from: 'gradle/codeQualityChecks.gradle' + diff --git a/lib/as3/build.properties b/lib/as3/build.properties deleted file mode 100644 index 8463668..0000000 --- a/lib/as3/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -# Maven Ant tasks Jar details -mvn.ant.task.version=2.1.3 -mvn.repo=http://repo1.maven.org/maven2 -mvn.ant.task.url=${mvn.repo}/org/apache/maven/maven-ant-tasks/${mvn.ant.task.version} -mvn.ant.task.jar=maven-ant-tasks-${mvn.ant.task.version}.jar diff --git a/lib/as3/build.xml b/lib/as3/build.xml deleted file mode 100755 index 2b374dd..0000000 --- a/lib/as3/build.xml +++ /dev/null @@ -1,182 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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="libthrift-as3" default="compile" basedir="." - xmlns:artifact="antlib:org.apache.maven.artifact.ant"> - - <property name="as3.artifactid" value="${ant.project.name}"/> - - <property name="thrift.root" location="${basedir}/../../"/> - <property name="thrift.java.dir" location="${thrift.root}/lib/java"/> - <property name="build.tools.dir" location="${thrift.java.dir}/build/tools/"/> - <property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/> - <property file="${basedir}/build.properties"/> - - <!-- inherit from the java build file for version and other properties --> - <property file="${thrift.java.dir}/gradle.properties" /> - - <property environment="env"/> - - <condition property="version" value="${thrift.version}"> - <isset property="release"/> - </condition> - <property name="version" value="${thrift.version}-SNAPSHOT"/> - - <property name="as3.final.name" value="${as3.artifactid}-${version}"/> - - <property name="src" value="${basedir}/src"/> - <property name="build.dir" value="${basedir}/build"/> - - <property name="as3.swc.file" location="${build.dir}/${as3.final.name}.swc"/> - <property name="as3.pom.xml" location="${build.dir}/${as3.final.name}.pom"/> - - <target name="init" depends="setup.init,flex.init" unless="init.finished"> - <property name="init.finished" value="true"/> - </target> - - <target name="setup.init"> - <tstamp/> - <mkdir dir="${build.dir}"/> - <mkdir dir="${build.tools.dir}"/> - </target> - - <target name="flex.check" unless="FLEX_HOME"> - <fail message='You must set the FLEX_HOME property pointing to your flex SDK, eg. ant -DFLEX_HOME="/Applications/Adobe Flex Builder 3/sdks/3.2.0"'/> - </target> - - <target name="flex.init" depends="flex.check" unless="flex.finished"> - <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" /> - <property name="flex.finished" value="true"/> - </target> - - <target name="compile" depends="init"> - <path id="as.src.files"> - <fileset dir="${src}/"> - <include name="**/*.as"/> - </fileset> - </path> - <pathconvert - property="as.src.classes" - pathsep=" " - dirsep="." - refid="as.src.files" - > - <map from="${src}/" to=""/> - <mapper type="glob" from="*.as" to="*"/> - </pathconvert> - - <compc output="${as3.swc.file}" include-classes="${as.src.classes}"> - <source-path path-element="${src}"/> - </compc> - </target> - - <target name="clean"> - <delete dir="${build.dir}" /> - </target> - - <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check" unless="mvn.ant.tasks.found"> - <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/> - </target> - - <target name="mvn.ant.tasks.check"> - <condition property="mvn.ant.tasks.found"> - <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/> - </condition> - </target> - - <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished"> - <echo message="${mvn.ant.task.jar}"/> - <!-- Download mvn ant tasks, download dependencies, and setup pom file --> - <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/> - - <!-- remote repositories used to download dependencies from --> - <artifact:remoteRepository id="central" url="${mvn.repo}"/> - <artifact:remoteRepository id="apache" url="${apache.repo}"/> - - <!-- Pom file information --> - <artifact:pom id="pom" - groupId="${thrift.groupid}" - artifactId="${as3.artifactid}" - version="${version}" - url="http://thrift.apache.org" - name="Apache Thrift" - description="Thrift is a software framework for scalable cross-language services development." - packaging="swc" - > - <remoteRepository refid="central"/> - <remoteRepository refid="apache"/> - <license name="The Apache Software License, Version 2.0" url="${license}"/> - <scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git" - developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git" - url="https://git-wip-us.apache.org/repos/asf?p=thrift.git" - /> - <!-- Thrift Developers --> - <developer id="mcslee" name="Mark Slee"/> - <developer id="dreiss" name="David Reiss"/> - <developer id="aditya" name="Aditya Agarwal"/> - <developer id="marck" name="Marc Kwiatkowski"/> - <developer id="jwang" name="James Wang"/> - <developer id="cpiro" name="Chris Piro"/> - <developer id="bmaurer" name="Ben Maurer"/> - <developer id="kclark" name="Kevin Clark"/> - <developer id="jake" name="Jake Luciani"/> - <developer id="bryanduxbury" name="Bryan Duxbury"/> - <developer id="esteve" name="Esteve Fernandez"/> - <developer id="todd" name="Todd Lipcon"/> - <developer id="geechorama" name="Andrew McGeachie"/> - <developer id="molinaro" name="Anthony Molinaro"/> - <developer id="roger" name="Roger Meier"/> - <developer id="jfarrell" name="Jake Farrell"/> - <developer id="jensg" name="Jens Geyer"/> - <developer id="carl" name="Carl Yeksigian"/> - </artifact:pom> - - <!-- Generate the pom file --> - <artifact:writepom pomRefId="pom" file="${as3.pom.xml}"/> - - <property name="mvn.finished" value="true"/> - </target> - - <macrodef name="signAndDeploy"> - <!-- Sign and deploy jars to apache repo --> - <attribute name="file"/> - <attribute name="classifier" default=""/> - <attribute name="packaging" default="jar"/> - <attribute name="pom" default=""/> - <sequential> - <artifact:mvn fork="true"> - <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/> - <arg value="-DrepositoryId=${maven-repository-id}"/> - <arg value="-Durl=${maven-repository-url}"/> - <arg value="-DpomFile=@{pom}"/> - <arg value="-Dfile=@{file}"/> - <arg value="-Dclassifier=@{classifier}"/> - <arg value="-Dpackaging=@{packaging}"/> - <arg value="-Pgpg"/> - </artifact:mvn> - </sequential> - </macrodef> - - <target name="publish" depends="clean,compile,mvn.init"> - <!-- Compile, packages and then send release to apache maven repo --> - <!-- run with: ant -Drelease=true publish --> - <signAndDeploy file="${as3.pom.xml}" packaging="pom" classifier="" pom="${as3.pom.xml}"/> - <signAndDeploy file="${as3.swc.file}" packaging="swc" classifier="" pom="${as3.pom.xml}"/> - </target> -</project> diff --git a/lib/java/gradle.properties b/lib/as3/gradle.properties similarity index 58% copy from lib/java/gradle.properties copy to lib/as3/gradle.properties index 58ca5f8..5d45da1 100644 --- a/lib/java/gradle.properties +++ b/lib/as3/gradle.properties @@ -4,6 +4,7 @@ thrift.version=0.12.0 thrift.groupid=org.apache.thrift release=false +sign=false # Local Install paths install.path=/usr/local/lib @@ -12,9 +13,6 @@ install.javadoc.path=/usr/local/lib # Test execution properties testPort=9090 -# Test with Clover Code coverage (disabled by default) -cloverEnabled=false - # Maven dependency download locations mvn.repo=http://repo1.maven.org/maven2 apache.repo=https://repository.apache.org/content/repositories/releases @@ -23,21 +21,3 @@ apache.repo=https://repository.apache.org/content/repositories/releases license=http://www.apache.org/licenses/LICENSE-2.0.txt maven-repository-url=https://repository.apache.org/service/local/staging/deploy/maven2 maven-repository-id=apache.releases.https - -# Dependency versions -httpclient.version=4.5.6 -httpcore.version=4.4.1 -slf4j.version=1.7.25 -servlet.version=2.5 -junit.version=4.12 -mockito.version=1.9.5 - -# Signing key information for artifacts PGP signature (values are examples) -# signing.keyId=ABCD0123 -# signing.password=signingPassword -# signing.secretKeyRingFile=/root/.gnupg/secring.gpg - -# Apache Maven staging repository user credentials -# mavenUser=mavenUser -# mavenPassword=mySuperSecretPassword - diff --git a/lib/as3/gradle/publishing.gradle b/lib/as3/gradle/publishing.gradle new file mode 100644 index 0000000..3e0ecf3 --- /dev/null +++ b/lib/as3/gradle/publishing.gradle @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +// Following Gradle best practices to keep build logic organized + +model { + tasks.signMavenPublication { + dependsOn compileFlex + } +} + +publishing { + publications { + maven(MavenPublication) { + + groupId = "$group" + artifactId = "${project.name}" + version = "$version" + + def swcFile = file("$buildDir/libthrift-as3.swc") + artifact(swcFile) + + pom { + description = 'Thrift is a software framework for scalable cross-language services development.' + packaging = 'swc' + + // older gradle doesn't recognize all the properties, so we inject them.. + withXml { + asNode().with { + appendNode('name', 'Apache Thrift') + appendNode('url', 'http://thrift.apache.org/') + appendNode('scm').with { + appendNode('url', 'https://github.com/apache/thrift/') + appendNode('connection', 'scm:git:https://github.com/apache/thrift.git') + appendNode('developerConnection', 'scm:git:[email protected]:apache/thrift.git') + } + appendNode('issueManagement').with { + appendNode('url', 'https://issues.apache.org/jira/projects/THRIFT/') + appendNode('system', 'Jira') + } + appendNode('licenses').with { + appendNode('license').with { + appendNode('name', 'The Apache Software License, Version 2.0') + appendNode('url', "${project.license}") + } + } + appendNode('organization').with { + appendNode('name', 'The Apache Software Foundation') + appendNode('url', 'http://www.apache.org/') + } + appendNode('developers').with { + appendNode('developer').with { + appendNode('id', 'dev') + appendNode('name', 'Apache Thrift Developers') + appendNode('email', '[email protected]') + } + } + } + } + } + } + } + repositories { + maven { + url = property('maven-repository-url') + + if (project.hasProperty('mavenUser') && project.hasProperty('mavenPassword')) { + credentials { + username = property('mavenUser') + password = property('mavenPassword') + } + } + } + } +} + +signing { + required { property('sign') } + sign publishing.publications.maven +} diff --git a/lib/as3/gradle/wrapper/gradle-wrapper.properties b/lib/as3/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..826c82f --- /dev/null +++ b/lib/as3/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip diff --git a/lib/as3/gradlew b/lib/as3/gradlew new file mode 100755 index 0000000..cccdd3d --- /dev/null +++ b/lib/as3/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/lib/as3/gradlew.bat b/lib/as3/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/lib/as3/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lib/as3/settings.gradle b/lib/as3/settings.gradle new file mode 100644 index 0000000..4932346 --- /dev/null +++ b/lib/as3/settings.gradle @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +rootProject.name = 'libthrift-as3' diff --git a/lib/java/build.gradle b/lib/java/build.gradle index 6dd35e4..5b0541b 100644 --- a/lib/java/build.gradle +++ b/lib/java/build.gradle @@ -46,7 +46,6 @@ defaultTasks 'build' group = property('thrift.groupid') // Drop the -dev suffix, we use the SNAPSHOT suffix for non-release versions -def parsedVersion = property('thrift.version').toString().replace('-dev', '') if (Boolean.parseBoolean(project.release)) { version = parsedVersion } else { diff --git a/lib/java/gradle.properties b/lib/java/gradle.properties index 58ca5f8..7fef76d 100644 --- a/lib/java/gradle.properties +++ b/lib/java/gradle.properties @@ -31,13 +31,3 @@ slf4j.version=1.7.25 servlet.version=2.5 junit.version=4.12 mockito.version=1.9.5 - -# Signing key information for artifacts PGP signature (values are examples) -# signing.keyId=ABCD0123 -# signing.password=signingPassword -# signing.secretKeyRingFile=/root/.gnupg/secring.gpg - -# Apache Maven staging repository user credentials -# mavenUser=mavenUser -# mavenPassword=mySuperSecretPassword -
