Skip to content

Commit

Permalink
improved script
Browse files Browse the repository at this point in the history
  • Loading branch information
stritti committed Apr 13, 2017
1 parent 819c1a4 commit d4fd4d5
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ artifacts {
archives sourcesJar, javadocJar
}

//task to send coverage data to Codacy
task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
main = "com.codacy.CodacyCoverageReporter"
classpath = configurations.codacy
Expand All @@ -115,7 +116,17 @@ task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {

publishing {
publications {

MyPublication(MavenPublication) {
//we have to change scope from runtime to compile. Especially for Gson-lib.
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile' }
}

if (plugins.hasPlugin('war')) {
from components.web
} else {
Expand All @@ -129,38 +140,28 @@ publishing {
artifact javadocJar
}

all {
//we have to change scope from runtime to compile. especially for Gson-lib.
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile' }
}
}
}
}

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')

publications = ['MyPublication']
//configurations = ['archives']

dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload

pkg {
repo = 'maven'
userOrg = 'sybit-education'
name = 'airtable.java'
licenses = ['MIT License']
vcsUrl = 'https://github.com/Sybit-Education/airtable.java.git'
version {
name = getVersionName()
released = new Date()
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')

publications = ['MyPublication']
//configurations = ['archives']

dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload

pkg {
repo = 'maven'
userOrg = 'sybit-education'
name = 'airtable.java'
licenses = ['MIT License']
vcsUrl = 'https://github.com/Sybit-Education/airtable.java.git'
version {
name = getVersionName()
released = new Date()
}
}
}

0 comments on commit d4fd4d5

Please sign in to comment.