diff --git a/.gitignore b/.gitignore index e605c3c..365bb93 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /out /src/main/generated/ /src/test/generated_tests/ +/gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index 9feeedf..43e8b12 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,13 @@ +import com.jfrog.bintray.gradle.BintrayExtension + plugins { java + `maven-publish` + id("com.jfrog.bintray") version "1.8.5" } group = "me.hltj" -version = "1.0.0-SNAPSHOT" +version = "1.0.0" repositories { mavenCentral() @@ -19,10 +23,69 @@ dependencies { } java { + withJavadocJar() + withSourcesJar() sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } +tasks.withType { + (options as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet") +} + tasks.withType { useJUnitPlatform() } + + +publishing { + publications { + create("bintray") { + from(components["java"]) + pom { + name.set("Vert.x Future Utils") + description.set("Convenient Utilities for Vert.x Future") + url.set("https://github.com/hltj/vertx-future-utils") + licenses { + license { + name.set("GNU Lesser General Public License") + url.set("https://www.gnu.org/licenses/lgpl-3.0.txt") + } + } + developers { + developer { + id.set("hltj") + name.set("JiaYanwei") + email.set("jiaywe@gmail.com") + } + } + scm { + url.set("https://github.com/hltj/vertx-future-utils.git") + } + } + } + } +} + +bintray { + user = propertyOrEnv("bintray.user", "BINTRAY_USER") + key = propertyOrEnv("bintray.key", "BINTRAY_KEY") + setPublications("bintray") + + with(pkg) { + repo = "mvn" + name = project.name + vcsUrl = "https://github.com/hltj/vertx-future-utils.git" + setLicenses("LGPL-3.0") + setLabels("vert.x", "future", "utilities", "utility-library") + + with(version) { + val versionString = project.version.toString() + name = versionString + vcsTag = versionString + } + } +} + +fun BintrayExtension.propertyOrEnv(propertyName: String, envName: String) = + project.properties[propertyName]?.toString() ?: System.getenv(envName)