1
+ // file:noinspection DifferentKotlinGradleVersion
1
2
buildscript {
2
- ext. kotlin_version = ' 1.1.51'
3
+ ext. kotlin_version = ' 1.4.32'
4
+
3
5
repositories {
4
6
mavenCentral()
5
7
}
8
+
6
9
dependencies {
7
10
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
8
11
}
9
12
}
10
13
11
- plugins { id " com.jfrog.bintray" version " 1.2" }
12
14
15
+ plugins {
16
+ id " java-library"
17
+ // id "application"
18
+ id " maven-publish"
19
+ id " signing"
20
+ id " io.github.gradle-nexus.publish-plugin" version " 1.1.0"
21
+ }
13
22
14
23
apply plugin : ' kotlin'
15
- apply plugin : ' application'
16
- apply plugin : ' maven'
17
- apply plugin : ' maven-publish'
18
-
19
- // mainClassName = 'demo.HelloWorldKt'
20
- mainClassName = " de.mpicbg.scicomp.kutils.BashKt" // not needed but does not work without
21
24
22
25
defaultTasks ' run'
23
26
24
27
repositories {
25
28
mavenCentral()
26
- mavenLocal()
29
+ // mavenLocal()
27
30
}
28
31
29
32
// https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_plugin_and_dependency_management
@@ -36,79 +39,62 @@ dependencies {
36
39
testCompile " io.kotlintest:kotlintest:2.0.1"
37
40
}
38
41
39
- // http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle
40
- task sourcesJar (type : Jar , dependsOn : classes) {
41
- classifier = ' sources'
42
- from sourceSets. main. allSource
43
- }
44
-
45
- task javadocJar (type : Jar , dependsOn : javadoc) {
46
- classifier = ' javadoc'
47
- from javadoc. destinationDir
42
+ java {
43
+ withJavadocJar()
44
+ withSourcesJar()
48
45
}
49
46
50
- // http://stackoverflow.com/questions/34377367/why-is-gradle-install-replacing-my-version-with-unspecified
51
- // group = 'de.mpicbg.scicomp'
52
47
group = ' com.github.holgerbrandl'
53
48
version = ' 1.2.5'
54
49
55
50
56
- artifacts {
57
- archives sourcesJar
58
- archives javadocJar
59
- }
60
-
61
51
publishing {
62
52
publications {
63
- maven(MavenPublication ) {
64
- from components. java
65
- artifact sourcesJar { classifier " sources" }
66
-
67
- // just needed because artifact name differs from project name
68
- version = project. version
69
- artifactId = ' kscript-support'
70
- groupId = project. group
53
+ mavenJava(MavenPublication ) {
54
+ from(components. java)
55
+
56
+ pom {
57
+ name = " kscript-support-api"
58
+ description = ' A support API to simplify scripting with kscript'
59
+ url = ' https://github.com/holgerbrandl/kscript-support-api'
60
+
61
+ licenses {
62
+ license {
63
+ name = ' MIT'
64
+ url = ' https://github.com/holgerbrandl/kscript-support-api/blob/master/LICENSE'
65
+ }
66
+ }
67
+
68
+
69
+ scm {
70
+ connection = ' scm:git:github.com/holgerbrandl/kscript-support-api.git'
71
+ url = ' https://github.com/holgerbrandl/kscript-support-api.git'
72
+ }
73
+
74
+
75
+ developers {
76
+ developer {
77
+ id = ' holgerbrandl'
78
+ name = ' Holger Brandl'
79
+ email = ' holgerbrandl@gmail.com'
80
+ }
81
+ }
82
+ }
71
83
}
72
84
}
73
85
}
74
86
75
87
76
- install {
77
- repositories. mavenInstaller {
78
- pom. version = project. version
79
- pom. artifactId = ' kscript-support'
80
- pom. groupId = project. group
81
- }
82
- }
83
-
84
- if (hasProperty(' bintray_user' ) && hasProperty(' bintray_key' )) {
85
- bintray {
86
-
87
- // property must be set in ~/.gradle/gradle.properties
88
- user = bintray_user
89
- key = bintray_key
90
-
91
- publications = [' maven' ] // When uploading configuration files
92
-
93
- dryRun = false // Whether to run this as dry-run, without deploying
94
- publish = true // If version should be auto published after an upload
95
-
96
- pkg {
97
- repo = ' github'
98
- name = ' kscript-support'
99
- vcsUrl = ' https://github.com/holgerbrandl/kscript-support-api'
100
-
101
- licenses = [' MIT' ]
102
- publicDownloadNumbers = true
103
-
104
- // Optional version descriptor
105
- version {
106
- name = project. version // Bintray logical version name
107
- desc = ' .'
108
- released = new java.util.Date ()
109
- vcsTag = ' v' + project. version
110
- }
88
+ nexusPublishing {
89
+ repositories {
90
+ sonatype {
91
+ snapshotRepositoryUrl = uri(project. properties[" sonatypeStagingProfileId" ])
92
+ username = project. properties[" ossrhUsername" ]
93
+ password = project. properties[" ossrhPassword" ]
111
94
}
112
- /**/
113
95
}
114
96
}
97
+
98
+ signing {
99
+ sign publishing. publications. mavenJava
100
+ }
0 commit comments