Skip to content

Commit 08aa80c

Browse files
committed
Merge branch 'dev' into rsh/AzureIdentityAuth
2 parents 95d46b7 + 8c480ee commit 08aa80c

File tree

9 files changed

+145
-169
lines changed

9 files changed

+145
-169
lines changed

build.gradle

Lines changed: 70 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
2-
* This build file was generated by the Gradle 'init' task.
2+
* This file was generated by the Gradle 'init' task.
33
*
44
* This generated file contains a sample Java Library project to get you started.
55
* For more details take a look at the Java Libraries chapter in the Gradle
6-
* user guide available at https://docs.gradle.org/4.5/userguide/java_library_plugin.html
6+
* User Manual available at https://docs.gradle.org/6.6/userguide/java_library_plugin.html
77
*/
88

9-
// Apply the java-library plugin to add support for Java Library
10-
apply plugin: 'java-library'
11-
apply plugin: 'java'
12-
apply plugin: 'eclipse'
13-
apply plugin: 'maven'
14-
apply plugin: 'maven-publish'
15-
apply plugin: 'signing'
16-
apply plugin: 'jacoco'
9+
plugins {
10+
// Apply the java-library plugin to add support for Java Library
11+
id 'java-library'
12+
id 'java'
13+
id 'eclipse'
14+
id 'maven-publish'
15+
id 'signing'
16+
}
1717

1818
// In this section you declare where to find the dependencies of your project
1919
repositories {
@@ -24,9 +24,6 @@ repositories {
2424
}
2525

2626
dependencies {
27-
// This dependency is exported to consumers, that is to say found on their compile classpath.
28-
api 'org.apache.commons:commons-math3:3.6.1'
29-
3027
// Use JUnit test framework
3128
testImplementation 'junit:junit:4.13'
3229
//Mockito Mock framework
@@ -35,8 +32,8 @@ dependencies {
3532
api 'com.squareup.okhttp3:okhttp:3.12.1'
3633

3734
// https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple
38-
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
3935
implementation 'com.azure:azure-identity:1.0.8'
36+
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
4037
}
4138

4239
def pomConfig = {
@@ -68,23 +65,33 @@ tasks.withType(Sign)*.enabled = mavenCentralPublishingEnabled.toBoolean()
6865
//Maven Central Snapshot: publishSnapshotPublicationToMavenRepository
6966
//Maven Central Release: publishMavenCentralReleasePublicationToMaven2Repository
7067
//Bintray Snapshot: publishSnapshotPublicationToMaven3Repository
71-
//Bintray Release: uploadArchives
7268

73-
publishing {
69+
task sourceJar(type: Jar) {
70+
from sourceSets.main.allJava
71+
archiveClassifier = 'sources'
72+
}
7473

75-
publications {
74+
task javadocJar(type: Jar, dependsOn: javadoc) {
75+
from javadoc.destinationDir
76+
archiveClassifier = 'javadoc'
77+
}
7678

77-
maven(MavenPublication) {
79+
signing {
80+
sign configurations.archives
81+
}
82+
tasks.withType(Sign)*.enabled = mavenCentralPublishingEnabled.toBoolean()
7883

79-
groupId 'com.microsoft.graph'
84+
publishing {
8085

81-
artifactId 'microsoft-graph-core'
86+
publications {
8287

88+
maven(MavenPublication) {
89+
groupId project.property('mavenGroupId')
90+
artifactId project.property('mavenArtifactId')
8391
version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenArtifactSuffix}"
84-
8592
from components.java
86-
8793
artifact sourceJar
94+
artifact javadocJar
8895
pom.withXml {
8996
def root = asNode()
9097
root.appendNode('name', 'Microsoft Graph Core SDK for Java')
@@ -97,26 +104,22 @@ publishing {
97104
}
98105
Snapshot(MavenPublication) {
99106
customizePom(pom)
100-
groupId 'com.microsoft.graph'
101-
artifactId 'microsoft-graph-core'
107+
groupId project.property('mavenGroupId')
108+
artifactId project.property('mavenArtifactId')
102109
version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenCentralSnapshotArtifactSuffix}"
103110
from components.java
104111
pom.withXml {
105112
def pomFile = file("${project.buildDir}/generated-pom.xml")
106113
writeTo(pomFile)
107114
}
108-
artifact(sourceJar) {
109-
classifier = 'sources'
110-
}
111-
artifact(javadocJar) {
112-
classifier = 'javadoc'
113-
}
115+
artifact sourceJar
116+
artifact javadocJar
114117
}
115118

116119
mavenCentralRelease(MavenPublication) {
117120
customizePom(pom)
118-
groupId 'com.microsoft.graph'
119-
artifactId 'microsoft-graph-core'
121+
groupId project.property('mavenGroupId')
122+
artifactId project.property('mavenArtifactId')
120123
version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}"
121124
from components.java
122125
pom.withXml {
@@ -128,12 +131,8 @@ publishing {
128131
extension = 'pom.asc'
129132
}
130133
}
131-
artifact(sourceJar) {
132-
classifier = 'sources'
133-
}
134-
artifact(javadocJar) {
135-
classifier = 'javadoc'
136-
}
134+
artifact sourceJar
135+
artifact javadocJar
137136
project.tasks.signArchives.signatureFiles.each {
138137
artifact(it) {
139138
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
@@ -150,55 +149,71 @@ publishing {
150149
}
151150
repositories {
152151
maven {
153-
url = project.property('mavenCentralSnapshotUrl')
152+
url = 'https://oss.sonatype.org/content/repositories/snapshots'
153+
name = 'sonatypeSnapshot'
154154

155155
credentials {
156156
if (project.rootProject.file('local.properties').exists()) {
157-
158157
Properties properties = new Properties()
159-
160158
properties.load(project.rootProject.file('local.properties').newDataInputStream())
161-
162159
username = properties.getProperty('sonatypeUsername')
163-
164160
password = properties.getProperty('sonatypePassword')
165-
166161
}
167162
}
168163
}
169164

170165
maven {
171-
url = project.property('mavenCentralReleaseUrl')
166+
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
167+
name = 'sonatype'
172168

173169
credentials {
174170
if (project.rootProject.file('local.properties').exists()) {
175-
176171
Properties properties = new Properties()
177-
178172
properties.load(project.rootProject.file('local.properties').newDataInputStream())
179-
180173
username = properties.getProperty('sonatypeUsername')
181-
182174
password = properties.getProperty('sonatypePassword')
183-
184175
}
185176
}
186177
}
187178

188179
maven {
189-
url = project.property('mavenBintraySnapshotUrl')
180+
url = 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
181+
name = 'jfrogSnapshot'
190182

191183
credentials {
192184
if (project.rootProject.file('local.properties').exists()) {
193-
194185
Properties properties = new Properties()
195-
196186
properties.load(project.rootProject.file('local.properties').newDataInputStream())
197-
198187
username = (properties.containsKey('bintray.user')) ? properties.getProperty('bintray.user').toLowerCase() : "BINTRAY_USERNAME"
188+
password = properties.getProperty('bintray.apikey')
189+
}
190+
}
191+
}
199192

193+
maven {
194+
url = 'https://oss.jfrog.org/artifactory/libs-release'
195+
name = 'jfrog'
196+
197+
credentials {
198+
if (project.rootProject.file('local.properties').exists()) {
199+
Properties properties = new Properties()
200+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
201+
username = (properties.containsKey('bintray.user')) ? properties.getProperty('bintray.user').toLowerCase() : "BINTRAY_USERNAME"
200202
password = properties.getProperty('bintray.apikey')
203+
}
204+
}
205+
}
201206

207+
maven {
208+
url = 'https://api.bintray.com/content/microsoftgraph/Maven/microsoft-graph-core'
209+
name = 'bintray'
210+
211+
credentials {
212+
if (project.rootProject.file('local.properties').exists()) {
213+
Properties properties = new Properties()
214+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
215+
username = (properties.containsKey('bintray.user')) ? properties.getProperty('bintray.user').toLowerCase() : "BINTRAY_USERNAME"
216+
password = properties.getProperty('bintray.apikey')
202217
}
203218
}
204219
}
@@ -219,58 +234,6 @@ def getVersionName() {
219234
return "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenArtifactSuffix}"
220235
}
221236

222-
uploadArchives {
223-
224-
def bintrayUsername = ""
225-
226-
def bintrayApikey = ""
227-
228-
if (project.rootProject.file('local.properties').exists()) {
229-
230-
Properties properties = new Properties()
231-
232-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
233-
234-
bintrayUsername = properties.getProperty('bintray.user')
235-
236-
bintrayApikey = properties.getProperty('bintray.apikey')
237-
238-
}
239-
240-
configuration = configurations.archives
241-
242-
repositories.mavenDeployer {
243-
244-
pom {
245-
246-
setGroupId project.mavenGroupId
247-
248-
setArtifactId project.mavenArtifactId
249-
250-
setVersion getVersionName()
251-
252-
}
253-
254-
repository (url: project.mavenRepoUrl) {
255-
256-
url = url + "/" + getVersionName()
257-
258-
authentication(
259-
260-
// put these values in local file ~/.gradle/gradle.properties
261-
262-
userName: project.hasProperty("bintrayUsername") ? project.bintrayUsername : bintrayUsername,
263-
264-
password: project.hasProperty("bintrayApikey") ? project.bintrayApikey : bintrayApikey
265-
266-
)
267-
268-
}
269-
270-
}
271-
272-
}
273-
274237
artifacts {
275238
archives jar
276239
archives sourceJar
@@ -338,7 +301,7 @@ model {
338301
tasks.publishMavenCentralReleasePublicationToMavenLocal {
339302
dependsOn project.tasks.signArchives
340303
}
341-
tasks.publishMavenCentralReleasePublicationToMaven2Repository {
304+
tasks.publishMavenCentralReleasePublicationToSonatypeRepository {
342305
dependsOn project.tasks.signArchives
343306
}
344307
}

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
## linux requires 10G, OSX requires 11G
2222
org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx2g
2323

24-
mavenRepoUrl = https://api.bintray.com/content/microsoftgraph/Maven/microsoft-graph-core
25-
mavenBintraySnapshotUrl = http://oss.jfrog.org/artifactory/oss-snapshot-local
2624
mavenGroupId = com.microsoft.graph
2725
mavenArtifactId = microsoft-graph-core
2826
mavenMajorVersion = 1
@@ -40,7 +38,5 @@ Username="USERNAME"
4038
Password="PASSWORD"
4139

4240
#enable mavenCentralPublishingEnabled to publish to maven central
43-
mavenCentralSnapshotUrl=https://oss.sonatype.org/content/repositories/snapshots
44-
mavenCentralReleaseUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2
4541
mavenCentralSnapshotArtifactSuffix = -SNAPSHOT
4642
mavenCentralPublishingEnabled=false

gradle/wrapper/gradle-wrapper.jar

4.32 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip

0 commit comments

Comments
 (0)