Skip to content

Commit

Permalink
Infrastructure updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Mar 29, 2020
1 parent 026cbfd commit 4dc0e74
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 69 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
@@ -1,12 +1,15 @@
language: java
script: gradle dist

script: "./gradlew dist"

install:
- echo sonatypeUsername=none >> gradle.properties
- echo sonatypePassword=none >> gradle.properties
- echo sonatypeUsername=none >> gradle.properties
- echo sonatypePassword=none >> gradle.properties

deploy:
provider: releases
api_key:
secure: aq3F/lf3megcm2IcxgTo4UdU6HHe88wnCmwWpSN+K4Xw1PkLcDzwe+GTYalBBZntqt1Jc8LO/9kntRLPEPAWIrlkG9puNE4DlNYDSleggNgyVIzLsu4nKcwO+o4Pk5ZbyiSypBqXlK4aARRNEvhmNU50s1vrm99VIaIjEBCpqJk=
secure: m+a8pXtE147nItyLKnnVJznyqoM14/IYMwDq+eS4+bHIctthqI91Q0cA7v0pz4DMNlq8ZRFT1wRjUGAA/qceMb15OMu+ZOoOoKTmrgozzoQgZt+AMHZ/O3SiMt9lJZCyRVh+OofeifBGOUdlTNTIveUPoqCr/g7jXq4lOMNBHGM=
file: build/distributions/xmlcalabash1-sendmail-$TRAVIS_TAG.zip
on:
tags: true
Expand Down
127 changes: 65 additions & 62 deletions build.gradle
Expand Up @@ -10,21 +10,18 @@ buildscript {

plugins {
id "java"
id "osgi"
id "maven"
id "maven-publish"
id "signing"
}

repositories {
mavenCentral()
maven { url "http://maven.restlet.org" }
maven { url "http://developer.marklogic.com/maven2" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://maven.restlet.org" }
}

configurations {
copydep {
extendsFrom runtime
extendsFrom implementation
}
copydep.exclude module: 'xmlcalabash'
copydep.exclude module: 'nwalsh-annotations'
Expand All @@ -33,21 +30,27 @@ configurations {
}

dependencies {
deployerJars "org.apache.maven.wagon:wagon-http:2.4"
deployerJars "org.apache.maven.wagon:wagon-http:3.3.4"

compile (
[group: 'com.nwalsh', name: 'nwalsh-annotations', version: '1.0.0'],
[group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.1-95'],
implementation (
[group: 'com.nwalsh', name: 'nwalsh-annotations', version: '1.0.1'],
[group: 'com.xmlcalabash', name: 'xmlcalabash', version: xmlCalabashVersion],
[group: 'javax.mail', name: 'javax.mail-api', version: '1.5.2']
)
}

// Variables
project.ext.saxonRelease = saxonVersion.substring(0,5)
project.ext.saxonBranch = saxonVersion.substring(0,3).replaceAll("\\.", "")
project.ext.releaseVersion = version
project.ext.distVersion = version + snapshot
version = project.ext.distVersion // - gets turned into . in some contexts
project.ext.releaseVersion = relVersion
project.ext.distVersion = relVersion + snapshot
relVersion = project.ext.distVersion // - gets turned into . in some contexts

compileJava {
options.deprecation = true
options.compilerArgs += ['-Xlint:deprecation']
options.annotationProcessorPath = configurations.compileClasspath
}

task copyLib(type: Copy) {
FileCollection lib = configurations.copydep
Expand All @@ -62,22 +65,23 @@ task copyLib(type: Copy) {
}

jar {
archiveBaseName = "xmlcalabash1-sendmail-" + relVersion
manifest {
instruction 'Built-By', builtBy
instruction 'Implementation-Vendor', 'Norman Walsh'
instruction 'Implementation-Title', 'XML Calabash Sendmail step'
instruction 'Implementation-Version', distVersion
instruction 'Bundle-SymbolicName', 'com.xmlcalabash.extensions.sendmail'
instruction 'Bundle-RequiredExecutionEnvironment', 'J2SE-1.7'
instruction 'Export-Package', '*, etc'
instruction 'Import-Package', 'net.sf.saxon.*;version=' + project.ext.saxonRelease + ',\
attributes 'Built-By': builtBy
attributes 'Implementation-Vendor': 'Norman Walsh'
attributes 'Implementation-Title': 'XML Calabash Sendmail step'
attributes 'Implementation-Version': distVersion
attributes 'Bundle-SymbolicName': 'com.xmlcalabash.extensions.sendmail'
attributes 'Bundle-RequiredExecutionEnvironment': 'J2SE-1.7'
attributes 'Export-Package': '*, etc'
attributes 'Import-Package': 'net.sf.saxon.*;version=' + project.ext.saxonRelease + ',\
javax.crypto.*,\
javax.xml.*,\
org.apache.commons.httpclient.*,\
org.xml.sax.*,\
*;resolution:=optional'
instruction 'DynamicImport-Package', '*'
instruction 'Class-Path', project.ext.runtimeClasspath + " lib"
attributes 'DynamicImport-Package': '*'
attributes 'Class-Path': project.ext.runtimeClasspath + " lib"
}
}

Expand Down Expand Up @@ -119,7 +123,7 @@ task copyJavaDoc(dependsOn: javadoc, type: Copy) {
}

task testStep(type: JavaExec) {
classpath = configurations.copydep + configurations.runtime + sourceSets.main.output
classpath = configurations.runtimeClasspath + sourceSets.main.output

main = 'com.xmlcalabash.drivers.Main'
maxHeapSize = "1024m"
Expand All @@ -128,73 +132,72 @@ task testStep(type: JavaExec) {

task makeDist(dependsOn: [ build, copyJar, copyLib ]) {
doLast {
println "Created distribution in build/dist"
println("Created distribution in build/dist")
}
}

task zipDist(dependsOn: makeDist, type: Zip) {
from('build/dist')
into 'xmlcalabash1-sendmail-' + distVersion
archiveName 'xmlcalabash1-sendmail-' + distVersion + ".zip"
archiveFileName = 'xmlcalabash1-sendmail-' + distVersion + ".zip"
}

task dist(dependsOn: [testStep, zipDist]) {
// nop
}

artifacts {
archives javadocJar
archives sourcesJar
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
sign publishing.publications
}

uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars

beforeDeployment { MavenDeployment deployment ->
signing.signPom(deployment) }

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)
}

pom.project {
name 'XML Calabash MarkLogic sendmail step'
packaging 'jar'
description 'XML Calabash extension step send email'
url 'https://github.com/ndw/xmlcalabash1-sendmail'
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'XML Calabash MarkLogic sendmail step'
packaging = 'jar'
description = 'XML Calabash extension step send email'
url = 'https://github.com/ndw/xmlcalabash1-sendmail'

scm {
url 'scm:git@github.com:ndw/xmlcalabash1-sendmail.git'
connection 'scm:git@github.com:ndw/xmlcalabash1-sendmail.git'
developerConnection 'scm:git@github.com:ndw/xmlcalabash1-sendmail.git'
url = 'scm:git@github.com:ndw/xmlcalabash1-sendmail.git'
connection = 'scm:git@github.com:ndw/xmlcalabash1-sendmail.git'
developerConnection = 'scm:git@github.com:ndw/xmlcalabash1-sendmail.git'
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}

developers {
developer {
id 'ndw'
name 'Norman Walsh'
id = 'ndw'
name = 'Norman Walsh'
}
}
}

groupId = "com.xmlcalabash"
artifactId = "xmlcalabash1-sendmail"
version = relVersion
from components.java
artifact javadocJar
artifact sourcesJar
}
}

repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}

6 changes: 3 additions & 3 deletions gradle.properties
@@ -1,8 +1,8 @@
version=1.1.4
relVersion=1.2.0
snapshot=

group=com.xmlcalabash
builtBy=Norman Walsh

saxonVersion=9.5.1-8

saxonVersion=9.9.1-7
xmlCalabashVersion=1.1.30-99
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 4dc0e74

Please sign in to comment.