Skip to content

Commit

Permalink
Merge pull request #2060 from microsoftgraph/fix/java-8-compatibility
Browse files Browse the repository at this point in the history
Add Java 8 CI checks
  • Loading branch information
Ndiritu authored Jul 3, 2024
2 parents 240dc91 + 1e82950 commit 743f2ad
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 4 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
build:
build-java-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -48,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 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
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions java-8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gradle
build/
31 changes: 31 additions & 0 deletions java-8/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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()
}

tasks.jar {
zip64(true)
}

apply from: "../gradle/dependencies.gradle"
2 changes: 2 additions & 0 deletions java-8/daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=8
3 changes: 3 additions & 0 deletions java-8/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

mavenArtifactId = msgraph-sdk-java
1 change: 1 addition & 0 deletions java-8/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'msgraph-sdk-java'

0 comments on commit 743f2ad

Please sign in to comment.