Repository: incubator-edgent Updated Branches: refs/heads/master c64a1c812 -> 89933b1b4
tidy up publishToMavenLocal support - publish groupId is org.apache.edgent - publish war when applicable Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/89933b1b Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/89933b1b Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/89933b1b Branch: refs/heads/master Commit: 89933b1b48c6b3226abba2394d03bcb62f2781cb Parents: c64a1c8 Author: Dale LaBossiere <[email protected]> Authored: Mon Aug 29 10:03:23 2016 -0400 Committer: Dale LaBossiere <[email protected]> Committed: Mon Aug 29 10:03:23 2016 -0400 ---------------------------------------------------------------------- DEVELOPMENT.md | 18 +++++++++++++++++- build.gradle | 42 ++++++++++++++++++++++++------------------ gradle.properties | 3 ++- 3 files changed, 43 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/89933b1b/DEVELOPMENT.md ---------------------------------------------------------------------- diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b220d47..28f0920 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -134,7 +134,23 @@ The build process has been tested on Linux and MacOSX. To build on Windows probably needs some changes, please get involved and contribute them! -**TODO: Continuous Integration with Gradle** +#### Publish to Maven Repository + +Initial support for publishing to a local Maven repository has been added. +Use the following to do the publish. + +``` +./gradlew publishToMavenLocal +``` + +The component jars / wars are published as well as their sources. +The published groupId is `org.apache.edgent`. The artifactIds match the +names of the jars in the target-dir / release tgz. + +E.g. `org.apache.edgent:edgent.api.topology:0.4.0` + + +#### **TODO: Continuous Integration with Gradle** ### Code Layout http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/89933b1b/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 5a6d6e6..c65bf09 100644 --- a/build.gradle +++ b/build.gradle @@ -25,6 +25,8 @@ allprojects { url 'https://repo.eclipse.org/content/repositories/paho-snapshots/' } } + + project.version = build_version } apply plugin: 'java' @@ -90,7 +92,6 @@ subprojects { } else { archivesBaseName = "${rootProject.name}${project.path.replace(':', '.')}" } - version = build_version dependencies { testCompile 'junit:junit:4.10' @@ -169,13 +170,6 @@ subprojects { configure jarOptions } - task sourceJar(type: Jar) { - // baseName-appendix-version-classifier.extension - from sourceSets.main.allJava - classifier = 'sources' - } - - task copyJar(type: Copy) { description = "Copy subproject's assembled artifacts to target_dir (implicitly builds jars due to 'from jar')" def projectGroup = "$project.group".replace("edgent.", "") @@ -217,19 +211,31 @@ subprojects { } } } + + task sourceJar(type: Jar) { + // baseName-appendix-version-classifier.extension + from sourceSets.main.allJava + classifier = 'sources' + } + // support for 'gradle publishToMavanLocal' etc + // TODO publishing test.{fvt,svt} and samples ... doesn't seem desirable? e.g., we're excluding test.{fvt,svt} jars from the tgz publishing { - publications { - mavenJava(MavenPublication) { - groupId "org.apache.edgent" - artifactId "$project.group".replace("edgent.", "") + "." + artifact - version build_version - artifact sourceJar - - from components.java + publications { + mavenJava(MavenPublication) { + // specify dependencies like: org.apache.edgent:edgent.api.topology:0.4.0 + groupId = build_group + artifactId = "${project.group}.${project.name}" + artifact sourceJar + if (project.pluginManager.hasPlugin('war')) { + from components.web } - } - } + else { + from components.java + } + } + } + } // assemble: inject updating target_dir assemble.finalizedBy copyJar http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/89933b1b/gradle.properties ---------------------------------------------------------------------- diff --git a/gradle.properties b/gradle.properties index bb04bea..203e52a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +build_group: org.apache.edgent build_name: edgent -build_version: 0.4.0 +build_version: 0.4.1 build_vendor: Apache Software Foundation
