From daf3b4a933b82cc50efaaba7eb5d853a54b53df0 Mon Sep 17 00:00:00 2001 From: Elmar Sonnenschein Date: Mon, 30 Dec 2019 10:32:30 +0100 Subject: [PATCH] Build optimizations --- GewtStrings.launch | 20 ++--- build.gradle | 8 +- gradle/wrapper/gradle-wrapper.properties | 2 +- publish.gradle | 98 ++++++++++++++++++++++++ settings.gradle | 4 +- 5 files changed, 117 insertions(+), 15 deletions(-) create mode 100644 publish.gradle diff --git a/GewtStrings.launch b/GewtStrings.launch index f6fd9cb..40fa630 100644 --- a/GewtStrings.launch +++ b/GewtStrings.launch @@ -1,13 +1,13 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/build.gradle b/build.gradle index 09fca1d..40f3b4b 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ configurations.all { if (targetProject != null) { dependency.useTarget (targetProject, "prefer local project") if (name.startsWith("compile")) // only log once - println "$project.name using local project $targetProject as dependency" + println "$project.name using local $targetProject as dependency" } } } @@ -110,3 +110,9 @@ bintray { } } } + +buildscript { + repositories { jcenter() } + dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+' } +} +apply from: 'publish.gradle' \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5028f28..9492014 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/publish.gradle b/publish.gradle new file mode 100644 index 0000000..1a1f5d6 --- /dev/null +++ b/publish.gradle @@ -0,0 +1,98 @@ +// bintray buildscript dependency needs to be added to build.gradle! +apply plugin: 'com.jfrog.bintray' +apply plugin: 'maven' +apply plugin: 'maven-publish' + +// ----------- Bintray Release ----------- + +bintray { + user = project.hasProperty('bintrayUser') ? + project.property('bintrayUser') : + System.getenv('BINTRAY_USER') + key = project.hasProperty('bintrayApiKey') ? + project.property('bintrayApiKey') : + System.getenv('BINTRAY_API_KEY') + + publish = true + configurations = ['archives'] + + // Maven Central sync currently disabled, as registration for OSS Sonatype + // needs some bureaucracy + // publications = ['MavenCentral'] + + pkg { + repo = 'sdack' + name = project.name + version { + name = project.version + vcsTag = project.version + gpg { + sign = false + } + mavenCentralSync { + sync = false + user = project.hasProperty('ossUser') ? + project.property('ossUser') : + System.getenv('OSS_USER') + password = project.hasProperty('ossPassword') ? + project.property('ossPassword') : + System.getenv('OSS_PASSWORD') + } + } + + } +} + +// -------------- Maven Local ------------ +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } +} + +// -------------- Maven POM -------------- +/* +def pomConfig = { + licenses { + license { + name "The Apache Software License, Version 2.0" + url "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution "repo" + } + } + developers { + developer { + name "esoco GmbH" + email "info@esoco.de" + } + } + + scm { + url "https://github.com/esoco/${project.name}" + } +} + +publishing { + publications { + MavenCentral(MavenPublication) { + from components.java + afterEvaluate { + artifact sourcesJar + artifact javadocJar + groupId project.group + artifactId project.name + version project.version + pom.withXml { + def root = asNode() + root.appendNode('description', project.description) + root.appendNode('name', "${project.group}:${project.name}") + root.appendNode('url', "https://github.com/esoco/${project.name}") + root.children().last() + pomConfig + } + } + } + } +} +*/ \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 94a5eb5..175bbf7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,7 +9,5 @@ buildscript { apply plugin: 'net.vivin.gradle-semantic-build-versioning' -['esoco-common'].each { - project -> if (new File("$rootDir/../$project").exists()) includeFlat project -} +includeFlat 'esoco-common'