@@ -8,9 +8,13 @@ buildscript {
88 }
99}
1010
11+ plugins { id " com.jfrog.bintray" version " 1.2" }
12+
13+
1114apply plugin : ' kotlin'
1215apply plugin : ' application'
1316apply plugin : ' maven'
17+ apply plugin : ' maven-publish'
1418
1519// mainClassName = 'demo.HelloWorldKt'
1620mainClassName = " de.mpicbg.scicomp.kutils.BashKt" // not needed but does not work without
@@ -32,15 +36,40 @@ dependencies {
3236 testCompile " io.kotlintest:kotlintest:2.0.1"
3337}
3438
35-
3639// http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle
3740task sourcesJar (type : Jar , dependsOn : classes) {
3841 classifier = ' sources'
3942 from sourceSets. main. allSource
4043}
4144
45+ task javadocJar (type : Jar , dependsOn : javadoc) {
46+ classifier = ' javadoc'
47+ from javadoc. destinationDir
48+ }
49+
50+ // http://stackoverflow.com/questions/34377367/why-is-gradle-install-replacing-my-version-with-unspecified
51+ group = ' de.mpicbg.scicomp'
52+ version = ' 1.1.4'
53+ // version = '1.1-SNAPSHOT'
54+
55+
4256artifacts {
4357 archives sourcesJar
58+ archives javadocJar
59+ }
60+
61+ publishing {
62+ publications {
63+ maven(MavenPublication ) {
64+ from components. java
65+ artifact sourcesJar { classifier " sources" }
66+
67+ // just needed because artifact name differs from projet name
68+ version = project. version
69+ artifactId = ' kscript'
70+ groupId = project. group
71+ }
72+ }
4473}
4574
4675// https://docs.gradle.org/current/userguide/maven_plugin.html
@@ -56,15 +85,43 @@ uploadArchives {
5685 }
5786}
5887
88+
5989install {
6090 repositories. mavenInstaller {
61- pom. version = ' 1.2-SNAPSHOT '
91+ pom. version = project . version
6292 pom. artifactId = ' kscript'
63- // pom.group = 'de.mpicbg.scicomp'
93+ pom. groupId = project . group
6494 }
6595}
6696
67- // http://stackoverflow.com/questions/34377367/why-is-gradle-install-replacing-my-version-with-unspecified
68- group = ' de.mpicbg.scicomp'
69- version = ' 1.2-SNAPSHOT'
70- // version = '1.1-SNAPSHOT'
97+ if (hasProperty(' bintray_user' ) && hasProperty(' bintray_key' )) {
98+ bintray {
99+
100+ // property must be set in ~/.gradle/gradle.properties
101+ user = bintray_user
102+ key = bintray_key
103+
104+ publications = [' maven' ] // When uploading configuration files
105+
106+ dryRun = false // Whether to run this as dry-run, without deploying
107+ publish = true // If version should be auto published after an upload
108+
109+ pkg {
110+ repo = ' mpicbg-scicomp'
111+ name = ' kscript'
112+ vcsUrl = ' https://github.com/holgerbrandl/kscript-support-api'
113+
114+ licenses = [' MIT' ]
115+ publicDownloadNumbers = true
116+
117+ // Optional version descriptor
118+ version {
119+ name = project. version // Bintray logical version name
120+ desc = ' .'
121+ released = new java.util.Date ()
122+ vcsTag = ' v' + project. version
123+ }
124+ }
125+ /**/
126+ }
127+ }
0 commit comments