Skip to content

Commit 647c210

Browse files
authored
FIX: Publish to git hub packages (#321)
* FIX: Publish to git hub packages * REFACTOR: Gradle script cleanup * BUMP: Moving kotlin 1.3.72
1 parent b3770d5 commit 647c210

File tree

40 files changed

+1844
-4686
lines changed

40 files changed

+1844
-4686
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
apply from: '../../../../build/gradle/slatekit-common.gradle'
2-
31
buildscript {
4-
ext.kotlin_version = '1.3.21'
2+
ext.kotlin_version = '1.3.72'
53
ext.slatekit_version = new File('../version.txt').text
64
ext.slatekit_version_beta = new File('../version-beta.txt').text
75

@@ -11,73 +9,36 @@ buildscript {
119
}
1210
dependencies {
1311
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.3"
1512
}
1613
}
1714

18-
apply plugin: 'java'
19-
apply plugin: 'kotlin'
20-
21-
22-
// ==================================================================
23-
// Slate Kit Component Info
24-
// ==================================================================
25-
def slatekitComponentId = 'connectors-cli'
26-
def slatekitComponentName = 'Connectors CLI'
27-
def slatekitComponentDesc = 'SlateKit Connectors: Connects the CLI and API modules'
28-
def slatekitComponentVersion = ext.slatekit_version
29-
30-
31-
// ==================================================================
32-
// Slate Kit Setup mode: defaults to maven vs loading project sources
33-
// ==================================================================
34-
ext.slatekitSetupViaBinary = System.getenv('SLATEKIT_PROJECT_MODE') != 'sources'
35-
task info {
36-
println('slatekit.setup : ' + System.getenv('SLATEKIT_PROJECT_MODE'))
37-
println('slatekit.maven : ' + slatekitSetupViaBinary)
38-
println('slatekit.comp.id : ' + slatekitComponentId)
39-
println('slatekit.comp.name : ' + slatekitComponentName)
40-
println('slatekit.comp.desc : ' + slatekitComponentDesc)
41-
println('slatekit.comp.vers : ' + slatekitComponentVersion)
42-
println()
43-
println('project.name : ' + project.name)
44-
println('project.path : ' + project.path)
45-
println('project.desc : ' + project.description)
46-
println('project.projectDir : ' + project.projectDir)
47-
println('project.buildDir : ' + project.buildDir)
48-
println()
49-
println('build.commit : ' + gitCommitId())
50-
println('build.branch : ' + gitBranchName())
51-
println('build.date : ' + getBuildDate())
15+
plugins {
16+
id "java"
17+
id "maven-publish"
18+
id "org.jetbrains.kotlin.jvm" version "$kotlin_version"
5219
}
5320

54-
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
21+
apply from: '../../../../build/gradle/slatekit-common.gradle'
22+
23+
compileJava {
5524
sourceCompatibility = JavaVersion.VERSION_1_8
5625
targetCompatibility = JavaVersion.VERSION_1_8
57-
58-
kotlinOptions {
59-
jvmTarget = '1.8'
60-
apiVersion = '1.3'
61-
languageVersion = '1.3'
62-
}
6326
}
6427

65-
6628
repositories {
6729
jcenter()
6830
mavenCentral()
6931
maven {
70-
url "https://dl.bintray.com/codehelixinc/slatekit"
71-
}
72-
maven {
73-
url "https://maven.pkg.github.com/code-helix/slatekit"
32+
url "https://maven.pkg.github.com/slatekit/slatekit"
7433
credentials {
7534
username = System.getenv('SLATEKIT_INSTALL_ACTOR')
7635
password = System.getenv('SLATEKIT_INSTALL_TOKEN')
7736
}
7837
}
7938
}
8039

40+
ext.slatekitSetupViaBinary = System.getenv('SLATEKIT_PROJECT_MODE') != 'sources'
41+
8142
dependencies {
8243

8344
//compile group: 'org.slf4j' , name: 'slf4j-api', version: '1.7.7'
@@ -100,128 +61,63 @@ dependencies {
10061
compile "com.slatekit:slatekit-cli:$slatekit_version"
10162
} else {
10263
// */
103-
compile project(":slatekit-result")
104-
compile project(":slatekit-common")
105-
compile project(":slatekit-context")
106-
compile project(":slatekit-apis")
107-
compile project(":slatekit-cli")
64+
compile project(":slatekit-result")
65+
compile project(":slatekit-common")
66+
compile project(":slatekit-context")
67+
compile project(":slatekit-apis")
68+
compile project(":slatekit-cli")
10869
} //</slatekit_local>
10970
}
11071

11172
// ==================================================================
112-
// BinTray Integration
73+
// Slate Kit Component Info
11374
// ==================================================================
114-
apply plugin: 'maven'
115-
apply plugin: 'maven-publish'
116-
apply plugin: 'com.jfrog.bintray'
117-
118-
119-
// Maven packages require the sources/docs.
120-
task sourcesJar(type: Jar, dependsOn: classes) {
121-
classifier = 'sources'
122-
from sourceSets.main.allSource
123-
}
124-
125-
javadoc.failOnError = false
126-
task javadocJar(type: Jar, dependsOn: javadoc) {
127-
classifier = 'javadoc'
128-
from javadoc.destinationDir
129-
}
130-
131-
artifacts {
132-
archives sourcesJar
133-
archives javadocJar
134-
}
135-
136-
def pomConfig = {
137-
licenses {
138-
license {
139-
name "Apache 2.0"
140-
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
141-
distribution "repo"
142-
}
143-
}
144-
developers {
145-
developer {
146-
id "codehelix"
147-
name "kishore reddy"
148-
email "kishore@codehelix.co"
149-
}
150-
}
75+
def slatekitComponentId = 'connectors-cli'
76+
def slatekitComponentName = 'Connectors CLI'
77+
def slatekitComponentDesc = 'SlateKit Connectors: Connects the CLI and API modules'
78+
def slatekitComponentVersion = ext.slatekit_version
15179

152-
scm {
153-
url "https://github.com/code-helix/slatekit-${slatekitComponentId}"
154-
}
80+
// ==================================================================
81+
// Slate Kit Setup mode: defaults to maven vs loading project sources
82+
// ==================================================================
83+
ext.slatekitSetupViaBinary = System.getenv('SLATEKIT_PROJECT_MODE') != 'sources'
84+
task info {
85+
println('slatekit.setup : ' + System.getenv('SLATEKIT_PROJECT_MODE'))
86+
println('slatekit.maven : ' + slatekitSetupViaBinary)
87+
println('slatekit.comp.id : ' + slatekitComponentId)
88+
println('slatekit.comp.name : ' + slatekitComponentName)
89+
println('slatekit.comp.desc : ' + slatekitComponentDesc)
90+
println('slatekit.comp.vers : ' + slatekitComponentVersion)
91+
println()
92+
println('project.name : ' + project.name)
93+
println('project.path : ' + project.path)
94+
println('project.desc : ' + project.description)
95+
println('project.projectDir : ' + project.projectDir)
96+
println('project.buildDir : ' + project.buildDir)
97+
println()
98+
println('build.commit : ' + gitCommitId())
99+
println('build.branch : ' + gitBranchName())
100+
println('build.date : ' + getBuildDate())
155101
}
156102

157103
publishing {
158-
publications {
159-
mavenPublication(MavenPublication) {
160-
from components.java
161-
artifact sourcesJar {
162-
classifier "sources"
163-
}
164-
artifact javadocJar {
165-
classifier "javadoc"
166-
}
167-
groupId 'com.slatekit'
168-
artifactId "slatekit-${slatekitComponentId}"
169-
version "${slatekitComponentVersion}"
170-
pom.withXml {
171-
def root = asNode()
172-
root.appendNode('description', "${slatekitComponentDesc}")
173-
root.appendNode('name', "SlateKit ${slatekitComponentName}")
174-
root.appendNode('url', "https://github.com/code-helix/slatekit-${slatekitComponentId}")
175-
root.children().last() + pomConfig
176-
}
177-
}
178-
}
179104
repositories {
180105
maven {
181-
url = "https://maven.pkg.github.com/code-helix/slatekit"
106+
name = "GitHubPackages"
107+
url = "https://maven.pkg.github.com/slatekit/slatekit"
182108
credentials {
183109
username = System.getenv("SLATEKIT_PUBLISH_ACTOR")
184110
password = System.getenv("SLATEKIT_PUBLISH_TOKEN")
185111
}
186112
}
187113
}
188-
}
189114

190-
// gradle bintrayUpload
191-
bintray {
192-
193-
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('SLATEKIT_BINTRAY_ACTOR')
194-
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('SLATEKIT_BINTRAY_TOKEN')
195-
publish = true
196-
//configurations = ['archives']
197-
publications = ['mavenPublication']
198-
pkg {
199-
repo = "slatekit"
200-
name = "slatekit-${slatekitComponentId}"
201-
userOrg = "codehelixinc"
202-
desc = "${slatekitComponentDesc}"
203-
websiteUrl = "http://www.slatekit.com/"
204-
issueTrackerUrl = "https://github.com/code-helix/slatekit-${slatekitComponentId}/issues"
205-
vcsUrl = "https://github.com/code-helix/slatekit-${slatekitComponentId}"
206-
licenses = ['Apache-2.0']
207-
publicDownloadNumbers = false
208-
version {
209-
name = "${slatekitComponentVersion}"
115+
publications {
116+
gpr(MavenPublication) {
117+
from(components.java)
118+
groupId 'com.slatekit'
119+
artifactId "slatekit-${slatekitComponentId}"
120+
version "${slatekitComponentVersion}"
210121
}
211122
}
212123
}
213-
214-
/* ==================================================================
215-
*
216-
* DEPLOY:
217-
* 1. ensure bin-tray user/pswd env vars are set: bintrayUser, bintrayApiKey
218-
* 2. replace the version number(s) in this file
219-
* 3. cd into root directory
220-
* 4. run gradle bintrayUpload
221-
*
222-
* LINKS:
223-
* https://reflectoring.io/guide-publishing-to-bintray-with-gradle/
224-
* https://stackoverflow.com/questions/52359686/configure-gradle-for-kotlin-with-java-1-7
225-
*
226-
* ===================================================================
227-
*/

0 commit comments

Comments
 (0)