Skip to content

Commit

Permalink
ENG-7817. Make maven upload scripts work from official kit builds.
Browse files Browse the repository at this point in the history
1. build-client.xml has a new target to make 2 new maven jars: javadoc and sources
2. Add step to build-kits.py to call maven-jars.
3. Add copy step to build-kits.py that will make a mavenjars/voltdb directory in the release directory. This will have the 3 .jar files (client, javadoc,sources) and a copy of upload.gradle
4. Changed upload.gradle to deal with the new pre-packaged world.
  • Loading branch information
rmorgenstein committed Mar 17, 2015
1 parent 9bcda87 commit fd9e19c
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 190 deletions.
10 changes: 10 additions & 0 deletions build-client.xml
Expand Up @@ -277,6 +277,16 @@ JAR BUILDING
</jar>
</target>

<target name="maven-jars"
description = "makes extra .jar files that get pushed to maven repo"
depends="stage_src, javadoc, buildinfo">
<jar destfile="${build.dir}/voltdbclient-${dist.version}-javadoc.jar"
basedir="${doc.dir}/javadoc/java-client-api"
/>
<jar destfile="${build.dir}/voltdbclient-${dist.version}-sources.jar"
basedir="${build.clientsrc.dir}"
/>
</target>

<!--
***************************************
Expand Down
28 changes: 28 additions & 0 deletions tools/kit_tools/build_kits.py
Expand Up @@ -109,6 +109,13 @@ def makeEnterpriseZip():
with cd(builddir + "/pro"):
run("VOLTCORE=../voltdb ant -f mmt.xml dist.pro.zip")

################################################
# MAKE AN JAR FILES NEEDED TO PUSH TO MAVEN
################################################

def makeMavenJars():
with cd(builddir + "/voltdb"):
run("VOLTCORE=../voltdb ant -f build-client.xml maven-jars")

################################################
# COPY FILES
Expand Down Expand Up @@ -140,6 +147,24 @@ def copyEnterpriseZipToReleaseDir(releaseDir, version, operatingsys):
get("%s/pro/obj/pro/voltdb-ent-%s.zip" % (builddir, version),
"%s/%s-voltdb-ent-%s.zip" % (releaseDir, operatingsys, version))

def copyMavenJarsToReleaseDir(releaseDir, version):
#The .jars and upload file must be in a directory called voltdb - it is the projectname
mavenProjectDir = releaseDir + "/mavenjars/voltdb"
if not os.path.exists(mavenProjectDir):
os.makedirs(mavenProjectDir)

#Get the voltdbclient-n.n.jar from the recently built community build
get("%s/voltdb/obj/release/dist-client-java/voltdb/voltdbclient-%s.jar" % (builddir, version),
"%s/voltdbclient-%s.jar" % (mavenProjectDir, version))
#Get the upload.gradle file
get("%s/voltdb/tools/kit_tools/upload.gradle" % (builddir),
"%s/upload.gradle" % (mavenProjectDir))
#Get the src and javadoc .jar files
get("%s/voltdb/obj/release/voltdbclient-%s-javadoc.jar" % (builddir, version),
"%s/voltdbclient-%s-javadoc.jar" % (mavenProjectDir, version))
get("%s/voltdb/obj/release/voltdbclient-%s-sources.jar" % (builddir, version),
"%s/voltdbclient-%s-sources.jar" % (mavenProjectDir, version))

################################################
# COMPUTE CHECKSUMS
################################################
Expand Down Expand Up @@ -257,6 +282,9 @@ def backupReleaseDir(releaseDir,archiveDir,version):
if versionHasZipTarget():
makeEnterpriseZip()
copyEnterpriseZipToReleaseDir(releaseDir, versionCentos, "LINUX")
makeMavenJars()
copyMavenJarsToReleaseDir(releaseDir, versionCentos)

except Exception as e:
print "Coult not build LINUX kit: " + str(e)
build_errors=True
Expand Down
113 changes: 113 additions & 0 deletions tools/kit_tools/upload.gradle
@@ -0,0 +1,113 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'

group = 'org.voltdb'

//Get the version string from the sources jar filename
def srcfilepath = new FileNameFinder().getFileNames ('.' , 'voltdbclient-*-sources.jar')[0]
def matcher = ( srcfilepath =~ /.*voltdbclient-(.*)-sources.jar$/)
version = matcher[0][1]
println version
description = 'VoltDB client interface libraries'
archivesBaseName = 'voltdbclient'

configurations {
clientArchives
ascSignatures
}

artifacts {
clientArchives file: file("voltdbclient-${version}.jar"), name:'voltdbclient',
classifier:null, type:'jar', extension:'jar'
clientArchives file: file("voltdbclient-${version}-javadoc.jar"), name:'voltdbclient',
classifier:'javadoc', type:'jar', extension:'jar'
clientArchives file: file("voltdbclient-${version}-sources.jar"), name:'voltdbclient',
classifier:'sources', type:'jar', extension:'jar'
}

signing {
sign configurations.clientArchives
}

task debug << {
configurations.clientArchives.artifacts.each { ca ->
println(['name','type','extension','classifier','file'].collect {
"${it}: ${ca.$/${it}/$}"
}.join(", "))
}
}

uploadClientArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment mvnd ->
signing.signPom(mvnd)
configurations.clientArchives.artifacts.each { ca ->
def ascfile = file(ca.file.path + '.asc')
def ascartf = project.artifacts.add('ascSignatures', ascfile) {
classifier = ca.classifier
extension = ca.extension + '.asc'
type = ca.type + '.asc'
}
mvnd.addArtifact(ascartf)
}
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
// repository(url: "file://localhost/Users/stefano/tmp/m2repo/")

pom.project {
name 'voltdbclient'
packaging 'jar'
description 'VoltDB client interface libraries'
url 'http://www.voltdb.com/'

scm {
url 'git@github.com:VoltDB/voltdb.git'
connection 'scm:git@github.com:VoltDB/voltdb.git'
developerConnection 'scm:git@github.com:VoltDB/voltdb.git'
}

licenses {
license {
name 'GNU Affero General Public License Version 3'
url 'http://www.gnu.org/licenses/agpl.txt'
distribution 'repo'
}
}

developers {
developer {
id 'jhugg'
name 'John Hugg'
email 'jhugg@voltdb.com'
organizationUrl 'http://www.voltdb.com'
}
developer {
id 'vtkstef'
name 'Stefano Santoro'
email 'ssantoro@voltdb.com'
organizationUrl 'http://www.voltdb.com'
}
developer {
id 'jpiekos'
name 'John Piekos'
email 'jpiekos@voltdb.com'
organizationUrl 'http://www.voltdb.com'
}
}
}
}
}
}

uploadClientArchives.dependsOn {
[signClientArchives]
}
190 changes: 0 additions & 190 deletions upload.gradle

This file was deleted.

0 comments on commit fd9e19c

Please sign in to comment.