Skip to content

Commit ff8e369

Browse files
github-actions[bot]wtgodbeBrennanConroy
authored
[release/9.0] Use MacOS-13 in CI (#58546)
* Use MacOS-13 in CI * Gradle 6.9 * Update gradle-wrapper.properties * Update gradle-wrapper.properties * Update build.gradle * Update build.gradle * Update build.gradle * Update build.gradle * Update build.gradle * Update build.gradle * Update build.gradle * Fixup gradle --------- Co-authored-by: William Godbe <[email protected]> Co-authored-by: Brennan <[email protected]>
1 parent 6cdcff9 commit ff8e369

File tree

10 files changed

+157
-96
lines changed

10 files changed

+157
-96
lines changed

.azure/pipelines/jobs/default-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
# See https://github.com/dotnet/arcade/blob/master/Documentation/ChoosingAMachinePool.md
107107
pool:
108108
${{ if eq(parameters.agentOs, 'macOS') }}:
109-
vmImage: macOS-12
109+
vmImage: macOS-13
110110
${{ if eq(parameters.agentOs, 'Linux') }}:
111111
${{ if eq(parameters.useHostedUbuntu, true) }}:
112112
vmImage: ubuntu-20.04
@@ -164,8 +164,8 @@ jobs:
164164
- script: df -h
165165
displayName: Disk size
166166
- ${{ if eq(parameters.agentOs, 'macOS') }}:
167-
- script: sudo xcode-select -s /Applications/Xcode_14.2.0.app/Contents/Developer
168-
displayName: Use XCode 14.2.0
167+
- script: sudo xcode-select -s /Applications/Xcode_15.2.0.app/Contents/Developer
168+
displayName: Use XCode 15.2.0
169169
- checkout: self
170170
clean: true
171171
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
@@ -323,7 +323,7 @@ jobs:
323323
pool:
324324
${{ if eq(parameters.agentOs, 'macOS') }}:
325325
name: Azure Pipelines
326-
image: macOS-12
326+
image: macOS-13
327327
os: macOS
328328
${{ if eq(parameters.agentOs, 'Linux') }}:
329329
name: $(DncEngInternalBuildPool)
@@ -391,8 +391,8 @@ jobs:
391391
- script: df -h
392392
displayName: Disk size
393393
- ${{ if eq(parameters.agentOs, 'macOS') }}:
394-
- script: sudo xcode-select -s /Applications/Xcode_14.2.0.app/Contents/Developer
395-
displayName: Use XCode 14.2.0
394+
- script: sudo xcode-select -s /Applications/Xcode_15.2.0.app/Contents/Developer
395+
displayName: Use XCode 15.2.0
396396
- checkout: self
397397
clean: true
398398
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:

eng/targets/Java.Common.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464

6565
<Target Name="Pack" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="$(PackDependsOn)">
6666
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Pack" />
67-
<Message Text="> gradlew $(GradleOptions) createPackage" Importance="high" />
68-
<Exec Command="../gradlew $(GradleOptions) createPackage" />
67+
<Message Text="> gradlew $(GradleOptions) publishToMavenLocal" Importance="high" />
68+
<Exec Command="../gradlew $(GradleOptions) publishToMavenLocal" />
6969
<Message Importance="high" Text="$(PackageId) -> $(PackageOutputPath)%(JavaBuildFiles.Identity)" />
7070
<Copy SourceFiles="$(MSBuildProjectDirectory)\build\libs\%(JavaBuildFiles.Identity)" DestinationFolder="$(PackageOutputPath)" />
7171
</Target>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"xcopy-msbuild": "17.1.0"
2525
},
2626
"native-tools": {
27-
"jdk": "11"
27+
"jdk": "11.0.24"
2828
},
2929
"msbuild-sdks": {
3030
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24516.2",

src/SignalR/clients/java/signalr/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ buildscript {
66
}
77
dependencies {
88
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.6.1"
9-
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
109
}
1110
}
1211

1312
plugins {
1413
id 'java'
15-
id 'maven'
14+
id 'maven-publish'
1615
}
1716

1817
allprojects {
@@ -22,7 +21,9 @@ allprojects {
2221
// If we're run from outside MSBuild, just assign a bogus dev version.
2322
version project.findProperty('packageVersion') ?: "99.99.99-dev"
2423

25-
sourceCompatibility = 1.8
24+
java {
25+
sourceCompatibility = 1.8
26+
}
2627

2728
repositories {
2829
mavenCentral()
@@ -52,4 +53,4 @@ spotless {
5253
indentWithSpaces(4)
5354
removeUnusedImports() // removes any unused imports
5455
}
55-
}
56+
}

src/SignalR/clients/java/signalr/core/build.gradle

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,67 @@
11
plugins {
22
id 'java'
3-
id 'maven'
3+
id 'maven-publish'
44
}
55

66
group 'com.microsoft.signalr'
77

8+
java {
9+
withJavadocJar()
10+
withSourcesJar()
11+
}
12+
813
dependencies {
914
implementation 'com.google.code.gson:gson:2.8.9'
1015
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
1116
api 'io.reactivex.rxjava3:rxjava:3.0.11'
1217
implementation 'org.slf4j:slf4j-api:1.7.25'
1318
}
1419

15-
archivesBaseName = 'signalr'
16-
17-
task sourceJar(type: Jar) {
18-
classifier "sources"
19-
from sourceSets.main.allJava
20+
base {
21+
archivesName = 'signalr'
2022
}
2123

22-
task javadocJar(type: Jar, dependsOn: javadoc) {
23-
classifier "javadoc"
24-
from javadoc.destinationDir
25-
}
24+
publishing {
25+
publications {
26+
release(MavenPublication) {
27+
from components.java
2628

27-
task generatePOM {
28-
pom {
29-
project {
3029
artifactId 'signalr'
31-
inceptionYear '2018'
3230
description 'ASP.NET Core SignalR Client for Java applications'
33-
url 'https://github.com/dotnet/aspnetcore'
34-
name groupId + ':' + artifactId
35-
licenses {
36-
license {
37-
name 'MIT License'
38-
url 'https://opensource.org/licenses/MIT'
39-
distribution 'repo'
31+
32+
pom {
33+
packaging = 'jar'
34+
inceptionYear = '2018'
35+
url = 'https://github.com/dotnet/aspnetcore'
36+
name = groupId + ':' + artifactId
37+
licenses {
38+
license {
39+
name = 'MIT License'
40+
url = 'https://opensource.org/licenses/MIT'
41+
distribution = 'repo'
42+
}
4043
}
41-
}
42-
scm {
43-
connection 'scm:git:https://github.com/dotnet/aspnetcore.git'
44-
developerConnection 'scm:git:https://github.com/dotnet/aspnetcore.git'
45-
url 'https://github.com/dotnet/aspnetcore/tree/main'
46-
}
47-
developers {
48-
developer {
49-
id 'microsoft'
50-
name 'Microsoft'
44+
scm {
45+
connection = 'scm:git:https://github.com/dotnet/aspnetcore.git'
46+
developerConnection = 'scm:git:https://github.com/dotnet/aspnetcore.git'
47+
url = 'https://github.com/dotnet/aspnetcore/tree/main'
48+
}
49+
developers {
50+
developer {
51+
id = 'microsoft'
52+
name = 'Microsoft'
53+
}
5154
}
5255
}
5356
}
54-
}.writeTo("${buildDir}/libs/signalr-${project.version}.pom")
57+
}
5558
}
5659

57-
task createPackage(dependsOn: [jar,sourceJar,javadocJar,generatePOM])
60+
tasks.withType(GenerateMavenPom).all {
61+
def matcher = name =~ /generatePomFileFor(\w+)Publication/
62+
def publicationName = matcher[0][1]
63+
destination = layout.buildDirectory.file("libs/signalr-${project.version}.pom").get().asFile
64+
}
5865

5966
task generateVersionClass {
6067
inputs.property "version", project.version

src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/DefaultHttpClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ public Single<HttpResponse> send(HttpRequest httpRequest, ByteBuffer bodyContent
116116
case "POST":
117117
RequestBody body;
118118
if (bodyContent != null) {
119-
body = RequestBody.create(MediaType.parse("text/plain"), ByteString.of(bodyContent));
119+
body = RequestBody.Companion.create(ByteString.of(bodyContent), MediaType.parse("text/plain"));
120120
} else {
121-
body = RequestBody.create(null, new byte[]{});
121+
body = RequestBody.Companion.create(new byte[]{}, null);
122122
}
123123

124124
requestBuilder.post(body);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=23e7d37e9bb4f8dabb8a3ea7fdee9dd0428b9b1a71d298aefd65b11dccea220f
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
3+
distributionSha256Sum=5b9c5eb3f9fc2c94abaea57d90bd78747ca117ddbbf96c859d3741181a12bf2a
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists
Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,64 @@
11
plugins {
22
id 'java'
3-
id 'maven'
3+
id 'maven-publish'
44
}
55

66
group 'com.microsoft.signalr.messagepack'
77

8+
java
9+
{
10+
withJavadocJar()
11+
withSourcesJar()
12+
}
13+
814
dependencies {
915
implementation project(':core')
10-
compile 'org.msgpack:msgpack-core:0.8.20'
11-
compile 'org.msgpack:jackson-dataformat-msgpack:0.8.20'
16+
implementation 'org.msgpack:msgpack-core:0.8.20'
17+
implementation 'org.msgpack:jackson-dataformat-msgpack:0.8.20'
1218
}
1319

14-
archivesBaseName = 'signalr-messagepack'
15-
16-
task sourceJar(type: Jar) {
17-
classifier "sources"
18-
from sourceSets.main.allJava
20+
base {
21+
archivesName = 'signalr-messagepack'
1922
}
2023

21-
task javadocJar(type: Jar, dependsOn: javadoc) {
22-
classifier "javadoc"
23-
from javadoc.destinationDir
24-
}
24+
publishing {
25+
publications {
26+
release(MavenPublication) {
27+
from components.java
2528

26-
task generatePOM {
27-
pom {
28-
project {
2929
artifactId 'signalr-messagepack'
30-
inceptionYear '2020'
3130
description 'MessagePack protocol implementation for ASP.NET Core SignalR Client for Java applications'
32-
url 'https://github.com/dotnet/aspnetcore'
33-
name groupId + ':' + artifactId
34-
licenses {
35-
license {
36-
name 'MIT License'
37-
url 'https://opensource.org/licenses/MIT'
38-
distribution 'repo'
31+
32+
pom {
33+
packaging = 'jar'
34+
inceptionYear = '2020'
35+
url = 'https://github.com/dotnet/aspnetcore'
36+
name = groupId + ':' + artifactId
37+
licenses {
38+
license {
39+
name = 'MIT License'
40+
url = 'https://opensource.org/licenses/MIT'
41+
distribution = 'repo'
42+
}
3943
}
40-
}
41-
scm {
42-
connection 'scm:git:https://github.com/dotnet/aspnetcore.git'
43-
developerConnection 'scm:git:https://github.com/dotnet/aspnetcore.git'
44-
url 'https://github.com/dotnet/aspnetcore/tree/main'
45-
}
46-
developers {
47-
developer {
48-
id 'microsoft'
49-
name 'Microsoft'
44+
scm {
45+
connection = 'scm:git:https://github.com/dotnet/aspnetcore.git'
46+
developerConnection = 'scm:git:https://github.com/dotnet/aspnetcore.git'
47+
url = 'https://github.com/dotnet/aspnetcore/tree/main'
48+
}
49+
developers {
50+
developer {
51+
id = 'microsoft'
52+
name = 'Microsoft'
53+
}
5054
}
5155
}
5256
}
53-
}.writeTo("${buildDir}/libs/signalr-messagepack-${project.version}.pom")
57+
}
5458
}
5559

56-
task createPackage(dependsOn: [jar,sourceJar,javadocJar,generatePOM])
60+
tasks.withType(GenerateMavenPom).all {
61+
def matcher = name =~ /generatePomFileFor(\w+)Publication/
62+
def publicationName = matcher[0][1]
63+
destination = layout.buildDirectory.file("libs/signalr-messagepack-${project.version}.pom").get().asFile
64+
}
Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,61 @@
1-
apply plugin: 'org.junit.platform.gradle.plugin'
1+
plugins {
2+
id 'java'
3+
}
4+
5+
configurations {
6+
antJUnit
7+
}
28

39
dependencies {
4-
implementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
5-
compile 'org.junit.jupiter:junit-jupiter-params:5.3.1'
6-
runtime 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
10+
implementation 'org.junit.jupiter:junit-jupiter-params:5.11.2'
11+
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.2'
12+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.2'
713
implementation 'com.google.code.gson:gson:2.8.5'
8-
compile 'ch.qos.logback:logback-classic:1.2.3'
14+
implementation 'ch.qos.logback:logback-classic:1.2.3'
915
implementation project(':core')
1016
implementation project(':messagepack')
11-
compile project(':messagepack')
17+
implementation project(':messagepack')
18+
antJUnit 'org.apache.ant:ant-junit:1.10.15'
19+
}
20+
21+
sourceSets {
22+
test {
23+
java {
24+
srcDir 'src'
25+
}
26+
}
27+
}
28+
29+
test {
30+
useJUnitPlatform()
31+
testLogging {
32+
events "passed", "skipped", "failed"
33+
}
34+
35+
reports {
36+
html.required = false
37+
junitXml.outputPerTestCase = true
38+
junitXml.required = true
39+
}
40+
}
41+
42+
// Merge test results into a single file for Helix to detect JUnit test file
43+
task testReport {
44+
ext {
45+
resultsDir = file("$buildDir/test-results")
46+
mergedFile = "test-results/junit-results.xml"
47+
}
48+
49+
doLast {
50+
mkdir 'test-results'
51+
ant.taskdef(name: 'junitreport',
52+
classname: 'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator',
53+
classpath: configurations.antJUnit.asPath)
54+
55+
ant.junitreport(tofile: mergedFile) {
56+
fileset(dir: resultsDir, includes: '**/TEST-*.xml')
57+
}
58+
}
1259
}
1360

14-
junitPlatform {
15-
reportsDir file('test-results')
16-
}
61+
test.finalizedBy(testReport)

src/SignalR/clients/java/signalr/test/signalr.client.java.Tests.javaproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
</PropertyGroup>
5050

5151
<ItemGroup>
52-
<HelixPostCommand Condition="'$(IsWindowsHelixQueue)' != 'true'" Include="cp %24{HELIX_WORKITEM_ROOT}/test/test-results/TEST-junit-jupiter.xml %24{HELIX_WORKITEM_ROOT}/junit-results.xml" />
53-
<HelixPostCommand Condition="'$(IsWindowsHelixQueue)' == 'true'" Include="copy %25HELIX_WORKITEM_ROOT%25\test\test-results\TEST-junit-jupiter.xml %25HELIX_WORKITEM_ROOT%25\junit-results.xml" />
52+
<HelixPostCommand Condition="'$(IsWindowsHelixQueue)' != 'true'" Include="cp %24{HELIX_WORKITEM_ROOT}/test/test-results/junit-results.xml %24{HELIX_WORKITEM_ROOT}/junit-results.xml" />
53+
<HelixPostCommand Condition="'$(IsWindowsHelixQueue)' == 'true'" Include="copy %25HELIX_WORKITEM_ROOT%25\test\test-results\junit-results.xml %25HELIX_WORKITEM_ROOT%25\junit-results.xml" />
5454
</ItemGroup>
5555

5656
</Project>

0 commit comments

Comments
 (0)