From dd5556337bb71de6dca612d0965d0e3fafa85d74 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 19 Jun 2024 18:50:45 +0300 Subject: [PATCH 1/8] Add Java 8 sub-project --- java-8/.gitignore | 2 ++ java-8/build.gradle | 27 +++++++++++++++++++++++++++ java-8/gradle.properties | 1 + java-8/settings.gradle | 1 + 4 files changed, 31 insertions(+) create mode 100644 java-8/.gitignore create mode 100644 java-8/build.gradle create mode 100644 java-8/gradle.properties create mode 100644 java-8/settings.gradle diff --git a/java-8/.gitignore b/java-8/.gitignore new file mode 100644 index 00000000000..7f6823bcc0f --- /dev/null +++ b/java-8/.gitignore @@ -0,0 +1,2 @@ +.gradle +build/ diff --git a/java-8/build.gradle b/java-8/build.gradle new file mode 100644 index 00000000000..5f63dc20ce6 --- /dev/null +++ b/java-8/build.gradle @@ -0,0 +1,27 @@ +plugins { + // Apply the java-library plugin to add support for Java Library + id 'java-library' + id 'eclipse' +} + +repositories { + mavenCentral() +} + +sourceSets { + main { + java { + srcDirs = ['../src'] + exclude 'test/**' + } + } +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + withSourcesJar() +} + +apply from: "../gradle/dependencies.gradle" diff --git a/java-8/gradle.properties b/java-8/gradle.properties new file mode 100644 index 00000000000..058f2d04b57 --- /dev/null +++ b/java-8/gradle.properties @@ -0,0 +1 @@ +mavenArtifactId = msgraph-sdk-java diff --git a/java-8/settings.gradle b/java-8/settings.gradle new file mode 100644 index 00000000000..f61f5ddf93b --- /dev/null +++ b/java-8/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'msgraph-sdk-java' From 6280c480933ec312c90f4d003d3a93275b51f802 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 19 Jun 2024 18:51:01 +0300 Subject: [PATCH 2/8] Add build steps to workflow --- .github/workflows/gradle-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 3be31cff616..91e02e37e03 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -24,6 +24,9 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build + - name: Build with Java 8 + working-directory: ./java-8 + run: .././gradlew build - name: Upload Unit Test Results if: ${{ always() }} uses: actions/upload-artifact@v4 From 9b765025510123092d89f55bafe3b646d41afaf2 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Thu, 20 Jun 2024 16:59:05 +0300 Subject: [PATCH 3/8] Increase max heap size for Java 8 build --- .github/workflows/gradle-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 91e02e37e03..981761b1c18 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -26,7 +26,7 @@ jobs: run: ./gradlew build - name: Build with Java 8 working-directory: ./java-8 - run: .././gradlew build + run: .././gradlew -Dorg.gradle.jvmargs=-Xmx8g build - name: Upload Unit Test Results if: ${{ always() }} uses: actions/upload-artifact@v4 From a9b8229d275d5a525ec22057849a68850e0f7ae8 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 3 Jul 2024 15:16:00 +0300 Subject: [PATCH 4/8] Bump compile and target android sdk version --- android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 294a3cb13ed..571d665222c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,13 +25,13 @@ apply plugin: "com.github.ManifestClasspath" android { namespace 'com.microsoft.graph' - compileSdkVersion 34 + compileSdkVersion 35 defaultConfig { versionCode 1 versionName "1.0" minSdkVersion 26 - targetSdkVersion 34 + targetSdkVersion 35 } buildTypes { From 568bb9a91668427de097735b1767afe61f6a2021 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 3 Jul 2024 15:20:02 +0300 Subject: [PATCH 5/8] Separate java latest and java 8 build jobs --- .github/workflows/gradle-build.yml | 33 ++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 981761b1c18..dd95aface5f 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - build: + build-java-latest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -24,9 +24,6 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build - - name: Build with Java 8 - working-directory: ./java-8 - run: .././gradlew -Dorg.gradle.jvmargs=-Xmx8g build - name: Upload Unit Test Results if: ${{ always() }} uses: actions/upload-artifact@v4 @@ -51,6 +48,34 @@ jobs: **/gradle/** Scripts/** + build-java-8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: 'temurin' + - name: Grant Execute permission for gradlew + run: chmod +x gradlew + - name: Build with Java 8 + working-directory: ./java-8 + run: .././gradlew -Dorg.gradle.jvmargs=-Xmx4g build + + build: + needs: [build-java-latest, build-java-8] + runs-on: ubuntu-latest + if: ${{ always() }} + steps: + - name: Determine build status + run: | + if [ "${{ needs.build-java-latest.result }}" == "success" ] && [ "${{ needs.build-java-8.result }}" == "success" ]; then + exit 0 + else + exit 1 + fi + compare-packages: needs: build runs-on: ubuntu-latest From 7ee5ac22737f55d967be40695947cd88d842d656 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 3 Jul 2024 15:21:48 +0300 Subject: [PATCH 6/8] Enable zip64 --- java-8/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java-8/build.gradle b/java-8/build.gradle index 5f63dc20ce6..56ce1751c3b 100644 --- a/java-8/build.gradle +++ b/java-8/build.gradle @@ -24,4 +24,8 @@ java { withSourcesJar() } +tasks.jar { + zip64(true) +} + apply from: "../gradle/dependencies.gradle" From 8ecf3351e08506ed739addbe29875e19bd7647e3 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 3 Jul 2024 15:31:39 +0300 Subject: [PATCH 7/8] Add daemon jvm properties file --- java-8/daemon-jvm.properties | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 java-8/daemon-jvm.properties diff --git a/java-8/daemon-jvm.properties b/java-8/daemon-jvm.properties new file mode 100644 index 00000000000..3bd3a411829 --- /dev/null +++ b/java-8/daemon-jvm.properties @@ -0,0 +1,2 @@ +#This file is generated by updateDaemonJvm +toolchainVersion=8 From 1e82950296c9c0098737b1a6661142b2766722a8 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Wed, 3 Jul 2024 15:47:20 +0300 Subject: [PATCH 8/8] Move JVM configs to gradle.properties --- .github/workflows/gradle-build.yml | 2 +- gradle.properties | 2 +- java-8/gradle.properties | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index dd95aface5f..a2b9837a632 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -61,7 +61,7 @@ jobs: run: chmod +x gradlew - name: Build with Java 8 working-directory: ./java-8 - run: .././gradlew -Dorg.gradle.jvmargs=-Xmx4g build + run: .././gradlew build build: needs: [build-java-latest, build-java-8] diff --git a/gradle.properties b/gradle.properties index c28d13ac7aa..b82610cfc6c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ # The size of the library demands a large amount of RAM to build. Increase as necessary if you get GC errors ## linux requires 10G, OSX requires 11G -org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.parallel=true org.gradle.caching=true diff --git a/java-8/gradle.properties b/java-8/gradle.properties index 058f2d04b57..51d218b5fc1 100644 --- a/java-8/gradle.properties +++ b/java-8/gradle.properties @@ -1 +1,3 @@ +org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + mavenArtifactId = msgraph-sdk-java