Skip to content

Commit 903e411

Browse files
authored
Merge pull request #13 from StringCare/develop
feature: migrated to sonatype repository. v4.2.1
2 parents 57999cc + 2f77caf commit 903e411

File tree

3 files changed

+44
-40
lines changed

3 files changed

+44
-40
lines changed

build.gradle

+42-38
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
plugins {
22
id 'java'
3-
id 'com.jfrog.bintray' version '1.8.5'
43
id 'org.jetbrains.kotlin.jvm' version '1.4.0'
5-
id "com.github.dcendents.android-maven" version "2.1"
4+
id 'maven-publish'
5+
id 'signing'
66
}
77

8-
group 'com.stringcare'
9-
version '4.0.1'
10-
118
def siteUrl = 'https://github.com/StringCare/KotlinGradlePlugin'
129
def gitUrl = 'https://github.com/StringCare/KotlinGradlePlugin.git'
1310

1411
sourceCompatibility = 1.8
1512

1613
repositories {
1714
google()
18-
jcenter()
1915
mavenCentral()
2016
}
2117

@@ -35,51 +31,59 @@ compileTestKotlin {
3531
kotlinOptions.jvmTarget = "1.8"
3632
}
3733

38-
install {
39-
repositories.mavenInstaller {
40-
pom {
41-
project {
42-
packaging 'aar'
43-
name 'StringCareAndroidPlugin'
44-
url siteUrl
45-
// Set your license
34+
group = "io.github.stringcare"
35+
version = "4.2.1"
36+
37+
Properties properties = new Properties()
38+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
39+
40+
publishing {
41+
publications {
42+
plugin(MavenPublication) {
43+
from components.java
44+
artifactId = "plugin"
45+
pom {
46+
packaging = 'aar'
47+
name = 'StringCareAndroidPlugin'
48+
description = "Stringcare Android library"
49+
url = siteUrl
50+
scm {
51+
connection = gitUrl
52+
developerConnection = gitUrl
53+
url = siteUrl
54+
}
4655
licenses {
4756
license {
48-
name 'The Apache Software License, Version 2.0'
49-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
57+
name = 'The Apache License, Version 2.0'
58+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
5059
}
5160
}
5261
developers {
5362
developer {
54-
id 'efraespada'
55-
name 'efraespada'
56-
email 'efraespada@gmail.com'
63+
id = 'efraespada'
64+
name = 'efraespada'
65+
email = 'efraespada@gmail.com'
5766
}
5867
}
59-
scm {
60-
connection gitUrl
61-
developerConnection gitUrl
62-
url siteUrl
63-
}
68+
}
69+
}
70+
}
71+
repositories {
72+
maven {
73+
//def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
74+
// def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
75+
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
76+
credentials {
77+
username = properties["nexusUsername"]
78+
password = properties["nexusPassword"]
6479
}
6580
}
6681
}
6782
}
6883

69-
Properties properties = new Properties()
70-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
71-
bintray {
72-
user = properties.getProperty("bintrayUser")
73-
key = properties.getProperty("bintrayApiKey")
74-
configurations = ['archives']
75-
pkg {
76-
repo = "maven"
77-
name = "StringCareAndroidPlugin"
78-
websiteUrl = siteUrl
79-
vcsUrl = gitUrl
80-
licenses = ["Apache-2.0"]
81-
publish = true
82-
}
84+
signing {
85+
useGpgCmd()
86+
sign publishing.publications.plugin
8387
}
8488

8589
processResources {

src/main/kotlin/components/Vars.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package components
22

3-
internal const val version = "4.0.1"
3+
internal const val version = "4.2.1"
44
internal const val testProjectName = "KotlinSample"
55
internal const val defaultMainModule = "app"
66
internal const val gradleTaskNameDoctor = "stringcarePreview"

src/test/kotlin/utils/Helper.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fun modifyForTest(directory: String, projectPath: String) {
1111
val current = File(".")
1212
val file = File("$directory${File.separator}$projectPath${File.separator}build.gradle")
1313
val content = file.getContent().replace(
14-
"classpath \"com.stringcare:plugin:\$stringcare_version\"",
14+
"classpath \"io.github.stringcare:plugin:\$stringcare_version\"",
1515
when (getOs()) {
1616
Os.WINDOWS -> "\nclasspath files(\"${current.absolutePath.replace("\\", "\\\\")}${File.separator}${File.separator}build${File.separator}${File.separator}libs${File.separator}${File.separator}plugin-$version.jar\")\n"
1717
Os.OSX -> "\nclasspath files(\"${current.absolutePath}${File.separator}build${File.separator}libs${File.separator}plugin-$version.jar\")\n"

0 commit comments

Comments
 (0)