fix get-edgent-jars for j7 and android Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/commit/ab0098af Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/tree/ab0098af Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/diff/ab0098af
Branch: refs/heads/develop Commit: ab0098af645b2a0c6e85cf10e6bf9f308cacec87 Parents: 6c7236f Author: Dale LaBossiere <dlab...@us.ibm.com> Authored: Wed Oct 11 10:00:38 2017 -0400 Committer: Dale LaBossiere <dlab...@us.ibm.com> Committed: Wed Oct 11 10:00:38 2017 -0400 ---------------------------------------------------------------------- .gitignore | 42 ++++++++++++++++++++++++++++++++++++++++++ console/.gitignore | 2 +- cron/.gitignore | 2 +- get-edgent-jars.sh | 30 ++++++++++++++++++++++++------ pom.xml | 2 +- template/pom.xml | 4 ++-- 6 files changed, 71 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/blob/ab0098af/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea30b70 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ + +# get-edgent-jars generated outout +get-edgent-jars-project + +*.class + +# Local developers toolchain +/toolchains-local.xml + +# Exclude the maven-wrapper.jar +.mvn/wrapper/maven-wrapper.jar + +# More generated artifacts +target/ +/test/svt/lib +/release-edgent +/reports +/.gradle/ +build/ +/externalJars + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# IntelliJ Idea +.idea/ +*.iml + +# Eclipse +.classpath +.project +.settings/ + +# Emacs +*~ http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/blob/ab0098af/console/.gitignore ---------------------------------------------------------------------- diff --git a/console/.gitignore b/console/.gitignore index a50dafe..d3cd401 100644 --- a/console/.gitignore +++ b/console/.gitignore @@ -1,2 +1,2 @@ # sample's output file -consoleUrl.txt \ No newline at end of file +consoleUrl.txt http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/blob/ab0098af/cron/.gitignore ---------------------------------------------------------------------- diff --git a/cron/.gitignore b/cron/.gitignore index ed3454e..127f7ab 100644 --- a/cron/.gitignore +++ b/cron/.gitignore @@ -1,3 +1,3 @@ # mkcrontab generated output -startapp.cron \ No newline at end of file +startapp.cron http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/blob/ab0098af/get-edgent-jars.sh ---------------------------------------------------------------------- diff --git a/get-edgent-jars.sh b/get-edgent-jars.sh index c00e72d..46a2bbf 100755 --- a/get-edgent-jars.sh +++ b/get-edgent-jars.sh @@ -17,7 +17,6 @@ # ## Get the Apache Edgent jars and their transitive external dependencies. -## Requires that maven (mvn) be installed and on the PATH ## ## By default get the Edgent java8 platform jars for the script's default Edgent version. ## @@ -28,13 +27,17 @@ ## --file gav-file get only the specified artifacts. Not restricted to Edgent jars. ## The Edgent version is substituted for all instances of '{EV}' ## Lines that begin with '#' are ignored. +## --mvn mvn-cmd use mvn-cmd instead of "./mvnw" ## ## Creates the directory get-edgent-jars-project and a maven project in it -USAGE="usage: [--platform {java8|java7|android}] [--version edgent-version] [--artifacts csv-gav-list] [--file gav-file]" +USAGE="usage: [--platform {java8|java7|android}] [--version edgent-version] [--artifacts csv-gav-list] [--file gav-file] [--mvn mvn-cmd]" set -e +SAMPLES_DIR=`(cd $(dirname $0); pwd)` +MVN_CMD=${SAMPLES_DIR}/mvnw + EDGENT_PLATFORM=java8 EDGENT_VERSION=1.2.0 SLF4J_VERSION=1.7.12 @@ -56,6 +59,9 @@ if [ "$1" = "--file" -a $# -gt 1 ]; then OPT_GAVS_FILE=$2; shift; shift OPT_GAVS=`sed -e '/^#/d' < ${OPT_GAVS_FILE}` fi +if [ "$1" = "--mvn" -a $# -gt 1 ]; then + MVN_CMD=$2; shift; shift +fi if [ $# != 0 ]; then echo "$USAGE" exit 1 @@ -132,11 +138,19 @@ confirm "Continue?" || exit ########################### if [ ! -d ${PROJ_DIR} ]; then echo "##### Generating maven project ${PROJ_DIR}..." - mvn -B archetype:generate \ + # ensure a standalone pom (no parent) to avoid unwanted inherited deps + TMP_PROJ=${PROJ_DIR}-tmp + mkdir ${TMP_PROJ} + cd ${TMP_PROJ} + ${MVN_CMD} -B archetype:generate \ -DarchetypeGroupId=org.apache.maven.archeTypes \ + -DarchetypeArtifactId=maven-archetype-quickstart \ -DgroupId=org.apache.edgent.tools \ -DartifactId=${PROJ_DIR} \ -Dversion=1.0 + cd .. + mv ${TMP_PROJ}/${PROJ_DIR} ${PROJ_DIR} + rmdir ${TMP_PROJ} cp ${PROJ_DIR}/pom.xml ${PROJ_DIR}/pom.xml.orig else cp ${PROJ_DIR}/pom.xml.orig ${PROJ_DIR}/pom.xml @@ -175,12 +189,16 @@ EOF ########################### echo echo "##### Retrieving jars into local maven repo..." -mvn clean compile +${MVN_CMD} clean compile ########################### echo echo "##### Copying jars..." -mvn dependency:copy-dependencies -DincludeScope=runtime +# if someone screws up j7 or android deps, uncomment the following and +# it will help identify wrong jars that are getting included / copied +# (and otherwise overwriting each other). +#DEBUG_DEPS=-Dmdep.prependGroupId=true +${MVN_CMD} dependency:copy-dependencies -DincludeScope=runtime ${DEBUG_DEPS} DEPS_SRC_DIR=target/dependency EDGENT_DEPS_DIR=${EDGENT_PLATFORM}/edgent-jars @@ -191,7 +209,7 @@ rm -rf "${EXT_DEPS_DIR}"; mkdir -p ${EXT_DEPS_DIR} cp ${DEPS_SRC_DIR}/* ${EXT_DEPS_DIR} -for i in `find ${EXT_DEPS_DIR} -name 'edgent-*.*ar'`; do +for i in `find ${EXT_DEPS_DIR} -name '*edgent-*.*ar'`; do mv $i ${EDGENT_DEPS_DIR} done http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/blob/ab0098af/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 794cc89..966abf8 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ <name>Apache Edgent: Samples</name> <properties> - <edgent.platform></edgent.platform> + <edgent.platform/> <!-- set by -Pplatform-* --> <edgent.base.groupId>org.apache.edgent${edgent.platform}</edgent.base.groupId> <edgent.version>1.2.0-SNAPSHOT</edgent.version> http://git-wip-us.apache.org/repos/asf/incubator-edgent-samples/blob/ab0098af/template/pom.xml ---------------------------------------------------------------------- diff --git a/template/pom.xml b/template/pom.xml index 593b958..fd8e7d4 100644 --- a/template/pom.xml +++ b/template/pom.xml @@ -21,11 +21,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <parent> + <!--parent> <groupId>org.apache</groupId> <artifactId>apache</artifactId> <version>18</version> - </parent> + </parent--> <!-- your Edgent Application coordinates here --> <groupId>com.mycompany.app</groupId>