|
1 | | -def VERSION_NAME = '0.2.0' |
2 | | - |
3 | | -buildscript { |
4 | | - repositories { |
5 | | - jcenter() |
6 | | - } |
7 | | -} |
| 1 | +def VERSION_NAME = '0.2.1' |
8 | 2 |
|
9 | 3 | repositories { |
10 | | - jcenter() |
| 4 | + mavenCentral() |
11 | 5 | } |
12 | 6 |
|
13 | 7 | apply plugin: 'java' |
14 | 8 | apply plugin: 'maven' |
15 | | -apply plugin: 'com.jfrog.bintray' |
| 9 | +apply plugin: 'signing' |
16 | 10 |
|
17 | 11 | dependencies { |
18 | 12 | implementation 'com.google.code.gson:gson:2.8.5' |
|
35 | 29 | } |
36 | 30 | } |
37 | 31 |
|
38 | | -version = VERSION_NAME |
39 | | - |
40 | 32 | task sourcesJar(type: Jar) { |
41 | 33 | from sourceSets.main.allSource |
42 | 34 | classifier = 'sources' |
@@ -65,60 +57,65 @@ ext { |
65 | 57 | licenseName = 'The MIT License' |
66 | 58 | licenseUrl = 'https://opensource.org/licenses/MIT' |
67 | 59 | allLicenses = ["MIT"] |
| 60 | + |
| 61 | + author = 'Shopify Inc.' |
68 | 62 | } |
69 | 63 |
|
70 | 64 | group = publishedGroupId |
| 65 | +archivesBaseName = artifact |
| 66 | +version = VERSION_NAME |
| 67 | + |
| 68 | +signing { |
| 69 | + required { gradle.taskGraph.hasTask("uploadArchives") } |
| 70 | + def signingKeyId = findProperty("signingKeyId") |
| 71 | + def signingKey = findProperty("signingKey") |
| 72 | + def signingPassword = findProperty("signingPassword") |
| 73 | + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) |
| 74 | + sign configurations.archives |
| 75 | +} |
| 76 | + |
| 77 | +uploadArchives { |
| 78 | + repositories { |
| 79 | + mavenDeployer { |
| 80 | + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 81 | + |
| 82 | + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 83 | + authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_PASSWORD")) |
| 84 | + } |
| 85 | + |
| 86 | + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 87 | + authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_PASSWORD")) |
| 88 | + } |
| 89 | + |
| 90 | + pom { |
| 91 | + project { |
| 92 | + groupId project.ext.publishedGroupId |
| 93 | + artifactId project.ext.artifact |
71 | 94 |
|
72 | | -install { |
73 | | - repositories.mavenInstaller { |
74 | | - // Generates POM.xml with proper parameters |
75 | | - pom { |
76 | | - project { |
77 | | - groupId publishedGroupId |
78 | | - artifactId artifact |
79 | | - |
80 | | - name libraryName |
81 | | - description libraryDescription |
82 | | - url siteUrl |
83 | | - |
84 | | - licenses { |
85 | | - license { |
86 | | - name licenseName |
87 | | - url licenseUrl |
| 95 | + name project.ext.libraryName |
| 96 | + description project.ext.libraryDescription |
| 97 | + url project.ext.siteUrl |
| 98 | + |
| 99 | + developers { |
| 100 | + developer { |
| 101 | + name project.ext.author |
| 102 | + } |
88 | 103 | } |
89 | | - } |
90 | 104 |
|
91 | | - scm { |
92 | | - connection gitUrl |
93 | | - developerConnection gitUrl |
94 | | - url siteUrl |
| 105 | + licenses { |
| 106 | + license { |
| 107 | + name project.ext.licenseName |
| 108 | + url project.ext.licenseUrl |
| 109 | + } |
| 110 | + } |
| 111 | + |
| 112 | + scm { |
| 113 | + connection = project.ext.gitUrl |
| 114 | + developerConnection = project.ext.gitUrl |
| 115 | + url = project.ext.siteUrl |
| 116 | + } |
95 | 117 | } |
96 | 118 | } |
97 | 119 | } |
98 | 120 | } |
99 | 121 | } |
100 | | - |
101 | | -bintray { |
102 | | - /* |
103 | | - These values can be found on https://bintray.com/profile/edit |
104 | | - BINTRAY_USER : your personal profile name (from "Your Profile") |
105 | | - BINTRAY_KEY : found on the left menu, under "API Key" |
106 | | - */ |
107 | | - user = System.getenv('BINTRAY_USER') |
108 | | - key = System.getenv('BINTRAY_KEY') |
109 | | - |
110 | | - configurations = ['archives'] |
111 | | - publish = true |
112 | | - pkg { |
113 | | - userOrg = 'shopify' |
114 | | - repo = 'shopify-java' |
115 | | - name = libraryName |
116 | | - desc = libraryDescription |
117 | | - websiteUrl = siteUrl |
118 | | - vcsUrl = gitUrl |
119 | | - licenses = allLicenses |
120 | | - version { |
121 | | - name = VERSION_NAME |
122 | | - } |
123 | | - } |
124 | | -} |
0 commit comments