Skip to content

Commit 743f2ad

Browse files
authored
Merge pull request #2060 from microsoftgraph/fix/java-8-compatibility
Add Java 8 CI checks
2 parents 240dc91 + 1e82950 commit 743f2ad

File tree

8 files changed

+71
-4
lines changed

8 files changed

+71
-4
lines changed

.github/workflows/gradle-build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
build:
11+
build-java-latest:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
@@ -48,6 +48,34 @@ jobs:
4848
**/gradle/**
4949
Scripts/**
5050
51+
build-java-8:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: Set up JDK
56+
uses: actions/setup-java@v4
57+
with:
58+
java-version: 8
59+
distribution: 'temurin'
60+
- name: Grant Execute permission for gradlew
61+
run: chmod +x gradlew
62+
- name: Build with Java 8
63+
working-directory: ./java-8
64+
run: .././gradlew build
65+
66+
build:
67+
needs: [build-java-latest, build-java-8]
68+
runs-on: ubuntu-latest
69+
if: ${{ always() }}
70+
steps:
71+
- name: Determine build status
72+
run: |
73+
if [ "${{ needs.build-java-latest.result }}" == "success" ] && [ "${{ needs.build-java-8.result }}" == "success" ]; then
74+
exit 0
75+
else
76+
exit 1
77+
fi
78+
5179
compare-packages:
5280
needs: build
5381
runs-on: ubuntu-latest

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ apply plugin: "com.github.ManifestClasspath"
2525
android {
2626
namespace 'com.microsoft.graph'
2727

28-
compileSdkVersion 34
28+
compileSdkVersion 35
2929

3030
defaultConfig {
3131
versionCode 1
3232
versionName "1.0"
3333
minSdkVersion 26
34-
targetSdkVersion 34
34+
targetSdkVersion 35
3535
}
3636

3737
buildTypes {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# The size of the library demands a large amount of RAM to build. Increase as necessary if you get GC errors
2121
## linux requires 10G, OSX requires 11G
22-
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
22+
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
2323
org.gradle.parallel=true
2424
org.gradle.caching=true
2525

java-8/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.gradle
2+
build/

java-8/build.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plugins {
2+
// Apply the java-library plugin to add support for Java Library
3+
id 'java-library'
4+
id 'eclipse'
5+
}
6+
7+
repositories {
8+
mavenCentral()
9+
}
10+
11+
sourceSets {
12+
main {
13+
java {
14+
srcDirs = ['../src']
15+
exclude 'test/**'
16+
}
17+
}
18+
}
19+
20+
java {
21+
toolchain {
22+
languageVersion = JavaLanguageVersion.of(8)
23+
}
24+
withSourcesJar()
25+
}
26+
27+
tasks.jar {
28+
zip64(true)
29+
}
30+
31+
apply from: "../gradle/dependencies.gradle"

java-8/daemon-jvm.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainVersion=8

java-8/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
2+
3+
mavenArtifactId = msgraph-sdk-java

java-8/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'msgraph-sdk-java'

0 commit comments

Comments
 (0)