geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbr...@apache.org
Subject [1/2] incubator-geode git commit: GEODE-19. Support for creating Maven distribution (closes #1)
Date Wed, 27 May 2015 22:03:22 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 524cac5f6 -> 1c9dc5a9b


GEODE-19. Support for creating Maven distribution (closes #1)

Support for creating Maven distribution

- Modified groupId to 'org.apache.geode'
- Modified distribution name to 'apache-geode'
- Modified version to include 'incubating'
- Updated README.md and RUNNING.txt with new directory name
- Added 'maven-publish' plugin for creating Maven distribution

Create Maven distribution: clean build publish
Install artifacts to local Maven repo: publishToMavenLocal

Tested by using Maven artifacts in a sample application which created a cache.

Wrap Tar properties in whenReady closure

In a pull request, @metatype suggested to use a whenReady closure. The Tar properties are
now wrapped in whenReady closure to prevent potential ordering issues.

Fix to only include copying spring-data-gemfire from provided configuration


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/748c451d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/748c451d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/748c451d

Branch: refs/heads/develop
Commit: 748c451d555863f2de7e40ddcb7c541b79a62f28
Parents: 1945905
Author: Mark Bretl <mbretl@pivotal.io>
Authored: Mon May 4 13:09:36 2015 -0700
Committer: Roman Shaposhnik <rvs@apache.org>
Committed: Mon May 11 12:41:41 2015 -0700

----------------------------------------------------------------------
 README.md                     |  4 +-
 RUNNING.txt                   |  2 +-
 build.gradle                  |  9 +++-
 gemfire-assembly/build.gradle | 92 +++++++++++++++++++++++++++++++++++++-
 gradle.properties             |  2 +-
 5 files changed, 103 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/748c451d/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index 7941ea4..d7e3a7d
--- a/README.md
+++ b/README.md
@@ -31,14 +31,14 @@ Geode includes the following features:
 
 # Geode in 5 minutes
 
-Obtain the source archive from Pivotal.  Extract and build from source (note: currently Geode
supports jdk1.7.75):
+Extract and build from source (note: currently Geode supports jdk1.7.75):
 
     $ cd geode
     $ ./gradlew build installDist
 
 Start a locator and server:
 
-    $ cd gemfire-assembly/build/install/geode
+    $ cd gemfire-assembly/build/install/apache-geode
     $ ./bin/gfsh
     gfsh> start locator --name=locator
     gfsh> start server --name=server

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/748c451d/RUNNING.txt
----------------------------------------------------------------------
diff --git a/RUNNING.txt b/RUNNING.txt
old mode 100644
new mode 100755
index ebb0ae7..8286657
--- a/RUNNING.txt
+++ b/RUNNING.txt
@@ -4,7 +4,7 @@ Create a distribution archive using
 
 Unpack the archive found in gemfire-assembly/build/distributions and run the gfsh shell
 
-cd apache-gemfire-*
+cd apache-geode-*
 bin/gfsh
 
 OR

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/748c451d/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 01a62df..bd0ec18 100755
--- a/build.gradle
+++ b/build.gradle
@@ -16,7 +16,7 @@ allprojects {
     maven { url "http://dist.gemstone.com/maven/release" }
   }
 
-  group = "io.pivotal.gemfire"
+  group = "org.apache.geode"
 
   apply plugin: 'idea'
   apply plugin: 'eclipse'
@@ -25,6 +25,13 @@ allprojects {
   if (!buildRoot.isEmpty()) {
     buildDir = buildRoot + project.path.replace(":", "/") + "/build"
   }
+
+  gradle.taskGraph.whenReady( { graph ->
+    tasks.withType(Tar).each { tar ->
+      tar.compression = Compression.GZIP
+      tar.extension = 'tar.gz'
+    }
+  })
 }
 
 def testResultsDir(def parent, def name) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/748c451d/gemfire-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-assembly/build.gradle b/gemfire-assembly/build.gradle
index 6e816d1..7580587 100755
--- a/gemfire-assembly/build.gradle
+++ b/gemfire-assembly/build.gradle
@@ -1,7 +1,19 @@
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath group: 'org.hibernate.build.gradle', name: 'gradle-maven-publish-auth',
version: '2.0.1'
+    }
+}
+
 apply plugin: 'distribution'
+apply plugin: 'maven-publish'
+apply plugin: 'maven-publish-auth'
 
 jar.enabled = false
 
+
 configurations {
   archives
 }
@@ -116,7 +128,7 @@ task gfshDepsJar (type: Jar, dependsOn: ':gemfire-core:classes') {
 
 distributions {
   main {
-    baseName = 'geode' //TODO rootProject.name
+    baseName = 'apache-geode' //TODO rootProject.name
     contents {
       duplicatesStrategy 'exclude'
       
@@ -143,6 +155,12 @@ distributions {
         from project(":gemfire-joptsimple").configurations.archives.allArtifacts.files
 
         from project(":gemfire-core").configurations.runtime
+        // Copying from provided configuration is only for supporting Spring Data GemFire.
+        // If there are more dependencies added to provided configuration, this will need
+        // to change
+        from (project(":gemfire-core").configurations.provided) {
+          include 'spring-data-gemfire-*'
+        }
         from project(":gemfire-core").configurations.archives.allArtifacts.files
 
         // include this jar        
@@ -165,6 +183,78 @@ distributions {
   }
 }
 
+
+// Repos to be added to POMs
+def springReleaseRepo = [ id:'spring-release', name:'Spring Maven RELEASE Repository', url:'https://repo.spring.io/release'
]
+def springMilestoneRepo = [ id:'spring-milestone', name:'Spring Maven MILESTONE Repository',
url:'https://repo.spring.io/milestone' ]
+def springSnapshotRepo = [ id:'spring-snapshot', name:'Spring Maven SNAPSHOT Repository',
url:'https://repo.spring.io/snapshot' ]
+def springLibsReleaseRepo = [ id:'libs-release', name:'Spring Maven libs-release Repository',
url:'http://repo.spring.io/libs-release' ]
+def springExtReleaseLocalRepo = [ id:'ext-release-local', name:'Spring Maven ext-release-local
Repository', url:'http://repo.spring.io/ext-release-local' ]
+
+def MavenRepos = [ springReleaseRepo, springSnapshotRepo, springLibsReleaseRepo, springExtReleaseLocalRepo
]
+
+// Jars to be published via Maven
+def coreJar = [publicationName:'coreJar', project:project(":gemfire-core").name]
+def jgroupsJar = [publicationName:'jgroupsJar', project:project(":gemfire-jgroups").name]
+def jsonJar = [publicationName:'jsonJar', project:project(":gemfire-json").name]
+def joptsimpleJar = [publicationName:'joptsimpleJar', project:project(":gemfire-joptsimple").name]
+def MavenJars = [ coreJar, jgroupsJar, jsonJar, joptsimpleJar ]
+
+afterEvaluate {
+  publishing {
+    publications {
+      MavenJars.each {
+        def publicationName = it.publicationName
+        def projectName = it.project
+        "$publicationName"(MavenPublication) {
+          artifactId projectName
+          artifact project(':' + projectName).jar
+          pom.withXml {
+            def repositoriesNode = asNode().appendNode('repositories')
+            MavenRepos.each {
+              def repositoryNode = repositoriesNode.appendNode('repository')
+              repositoryNode.appendNode('id', it.id)
+              repositoryNode.appendNode('name', it.name)
+              repositoryNode.appendNode('url', it.url)
+            }
+            def dependenciesNode = asNode().appendNode('dependencies')
+            //Iterate over the runtime dependencies
+            project(':' + projectName).configurations.runtime.allDependencies.each {
+              def dependencyNode = dependenciesNode.appendNode('dependency')
+              dependencyNode.appendNode('groupId', it.group)
+              dependencyNode.appendNode('artifactId', it.name)
+              dependencyNode.appendNode('version', it.version)
+            }
+          }
+        }
+      }
+    }
+  }
+
+  // The following is typically defined in a root ASF pom: org.apache:apache
+  // If anything breaks around publishing check that we're still synchronized
+  // with whatever Maven repo definitions are there. Pay special attention to
+  // the names of the repositories -- they need to be spelled exactly like
+  // the ones defined in root ASF pom
+  publishing {
+    repositories {
+      if (project.version.endsWith('-SNAPSHOT')) {
+        // Apache Development Snapshot Repository
+        maven {
+          name "apache.snapshots.https"
+          url "https://repository.apache.org/content/repositories/snapshots"
+        }
+      } else {
+        // Apache Release Distribution Repository
+        maven {
+          name "apache.releases.https"
+          url "https://repository.apache.org/service/local/staging/deploy/maven2"
+        }
+      }
+    }
+  } 
+}
+
 artifacts {
   archives depsJar, gfshDepsJar
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/748c451d/gradle.properties
----------------------------------------------------------------------
diff --git a/gradle.properties b/gradle.properties
old mode 100644
new mode 100755
index 40257ca..4defd89
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
-version = 1.0.0.0-SNAPSHOT
+version = 1.0.0-incubating-SNAPSHOT
 org.gradle.daemon = true
 org.gradle.jvmargs = -Xmx2048m
 


Mime
View raw message