build java7 and android targets - make platform/java7/build.xml sufficiently overridable - add clean to platform/android/build.xml; explicitly omit console things - add missing components to JAVA_SUPPORT.md - fix java7 to include connector/http/ext (needed because java7 includes edgent.connectors.http.jar and is doc'd as supporting it) - add build.gradle to platform/{android,java7} - add dependencies for java7,android to build.gradle
With this commit, "./gradlew release" seems to correctly assemble java7 and android in the gradle targetDir. TODO java7,android test TODO building of android/{hardware,topology} Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/43468700 Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/43468700 Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/43468700 Branch: refs/heads/master Commit: 434687002604f8f3e4d2c829e64499f7b3d826c3 Parents: 7b85f48 Author: Dale LaBossiere <dlab...@us.ibm.com> Authored: Thu Sep 1 12:00:44 2016 -0400 Committer: Dale LaBossiere <dlab...@us.ibm.com> Committed: Thu Sep 1 12:00:44 2016 -0400 ---------------------------------------------------------------------- build.gradle | 11 +++--- platform/android/build.gradle | 63 ++++++++++++++++++++++++++++++++ platform/java7/build.gradle | 74 ++++++++++++++++++++++++++++++++++++++ settings.gradle | 2 ++ 4 files changed, 146 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/43468700/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 897ad74..1d1659c 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,8 @@ ext { // TODO can these be deduced by the absence of a build.gradle for the project? aggregatorOnlyProjects = [ ':analytics', ':api', ':apps', - ':connectors', ':console', ':providers', + ':connectors', ':console', + ':platform', ':providers', ':runtime', ':samples', ':spi', ':test', ':utils' ] @@ -810,10 +811,12 @@ task cleanAll { task release { description = 'Assemble distribution artifacts, populate target_dir, and create a release tgz' - dependsOn cleanAll, addMiscDistFiles, assemble, releaseTarGz + dependsOn cleanAll, addMiscDistFiles, assemble, + ':platform:java7:addJava7Target', ':platform:android:addAndroidTarget', + releaseTarGz addMiscDistFiles.mustRunAfter cleanAll - all.mustRunAfter addMiscDistFiles - releaseTarGz.mustRunAfter assemble + assemble.mustRunAfter addMiscDistFiles + releaseTarGz.mustRunAfter assemble,':platform:java7:addJava7Target',':platform:android:addAndroidTarget' } task reports { http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/43468700/platform/android/build.gradle ---------------------------------------------------------------------- diff --git a/platform/android/build.gradle b/platform/android/build.gradle new file mode 100644 index 0000000..8231922 --- /dev/null +++ b/platform/android/build.gradle @@ -0,0 +1,63 @@ +/* + * 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. + */ + +defaultTasks 'addAndroidTarget' + +// Avoid creating/staging an empty jar (this is a 'java' subproject) +jar { + deleteAllActions() +} + +// let the existing ant script do all of the work + +ant.importBuild('build.xml') { antTargetName -> + 'ant_' + antTargetName +} + +ant.properties['edgent8.target'] = target_java8_dir +ant.properties['edgent7.target'] = target_java7_dir +ant.properties['edgent.android.target'] = target_android_dir + +clean { + dependsOn ant_clean +} + +task addAndroidTarget { + description = "Assemble distribution artifacts for android (from java7 artifacts)" + dependsOn ':platform:java7:addJava7Target', clean, ant_all + ant_all.mustRunAfter ':platform:java7:addJava7Target' + ant_all.mustRunAfter clean + + // TODO the following isn't cutting it for adding up-to-date for this task + // so as to avoid unnecessarily running clean,ant_all + // ... well things just don't quite work the way I hoped. + // A task's dependencies are run before a task is checked for UTD + // inputs.dir(target_java7_dir) + // outputs.dir(target_android_dir) +} + +// unlike the above, this has the benefit(?) of producing the ant output to stdout +// But it requires 'ant' to be in the path and doesn't (can't?) use +// the ant that's embedded with gradle hmm... +// +//task androidXXX(type: Exec) { +// description = "Assemble distribution artifacts for android (from java7 artifacts)" +// dependsOn :platform:java7:java7 +// workingDir 'platform/android' +// commandLine 'ant', 'clean', 'all', +// '-Dedgent8.target=../../build/distributions/java8', +// '-Dedgent7.target=../../build/distributions/java7', +// '-Dedgent.android.target=../../build/distributions/android' +//} + http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/43468700/platform/java7/build.gradle ---------------------------------------------------------------------- diff --git a/platform/java7/build.gradle b/platform/java7/build.gradle new file mode 100644 index 0000000..df747eb --- /dev/null +++ b/platform/java7/build.gradle @@ -0,0 +1,74 @@ +/* + * 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. + */ + +defaultTasks 'addJava7Target' + +// Avoid creating/staging an empty jar (this is a 'java' subproject) +jar { + deleteAllActions() +} + +// let the existing ant script do all of the work + +ant.importBuild('build.xml') { antTargetName -> + 'ant_' + antTargetName +} + +ant.properties['edgent8.target'] = target_java8_dir +ant.properties['edgent7.target'] = target_java7_dir +ant.properties['ext.dir'] = target_java8_ext_dir +ant.properties['slf4j.ext.dir'] = "" +ant.properties['gson.ext.dir'] = "" +ant.properties['metrics.ext.dir'] = "" + +clean { + dependsOn ant_clean +} + +ant_retro7.doFirst { + println "Performing a long running ant task (run with --info to see it all)..." +} + +task addJava7Target { + description = "Assemble distribution artifacts for java7 (from java8 artifacts)" + dependsOn ':assemble', clean, ant_retro7 + ant_retro7.mustRunAfter clean + ant_retro7.mustRunAfter ':assemble' + + // TODO the following isn't cutting it for adding up-to-date for this task + // so as to avoid unnecessarily running clean,retro7 + // ... well things just don't quite work the way I hoped. + // A task's dependencies are run before a task is checked for UTD + // inputs.dir(target_java8_dir) + // outputs.dir(target_java7_dir) +} + +// unlike the above, this has the benefit(?) of producing the ant output to stdout +// But it requires 'ant' to be in the path and doesn't (can't?) use +// the ant that's embedded with gradle hmm... +// +//task java7XXX(type: Exec) { +// description = "Assemble distribution artifacts for java7 (from java8 artifacts)" +// dependsOn ':assemble' +// workingDir 'platform/java7' +// commandLine 'ant', 'clean', 'retro7', +// '-Dedgent8.target=../../build/distributions/java8', +// '-Dedgent7.target=../../build/distributions/java7', +// '-Dext.dir=../../build/distributions/java8/ext', +// '-Dslf4j.ext.dir=""', +// '-Dgson.ext.dir=""', +// '-Dmetrics.ext.dir=""' +//} + + http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/43468700/settings.gradle ---------------------------------------------------------------------- diff --git a/settings.gradle b/settings.gradle index 64d96cc..1a46149 100644 --- a/settings.gradle +++ b/settings.gradle @@ -64,5 +64,7 @@ include 'samples:console' include 'samples:scenarios' include 'test:fvtiot' include 'test:svt' +include 'platform:java7' +include 'platform:android' rootProject.name = build_name