Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building on ARM64 #290

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ apply plugin: 'signing'

allprojects {
apply plugin: 'java'
ext.isArm = System.getProperty('os.arch') == 'aarch64'

group = 'org.quiltmc'

Expand Down Expand Up @@ -113,20 +114,31 @@ void createJavaTestDataSet(int version, String suffix = "", List<String> compile
}
tasks.getByName("compileTestDataJava${version}${suffix}Java") {
destinationDirectory = file("testData/classes/java${version}${suffix.toLowerCase()}")
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(version)
if (project.isArm && version > 8 && version < 11) {
// On ARM systems, a more limited set of JVM versions are available
// We'll accept the `--release` flag so development is at least somewhat possible
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(11)
}
options.release = version
} else {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(version)
}
}

options.compilerArgs = compilerArgs
}
testDataClasses.dependsOn("testDataJava${version}${suffix}Classes")
}

def testJavaRuntimes = [:]

[8, 9, 11, 16, 17].forEach { version ->
[8, 9, 11, 16, 17].forEach { version ->
def runtimeVersion = isArm && version > 8 && version < 11 ? 11 : version
createJavaTestDataSet(version)
testJavaRuntimes[version] = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(version)
languageVersion = JavaLanguageVersion.of(runtimeVersion)
}
}
[16, 17, 19].forEach { version -> createJavaTestDataSet(version, "Preview", ["--enable-preview"]) }
Expand Down
25 changes: 19 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
pluginManagement {
repositories {
mavenCentral() // avoid delegating to JCenter to minimize outages
gradlePluginPortal()
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.6.0'
}

rootProject.name = 'vineflower'

include 'idea-not-null'
project(":idea-not-null").projectDir = (new File(rootProject.projectDir, "plugins/idea-not-null"))
include 'kotlin'
project(":kotlin").projectDir = (new File(rootProject.projectDir, "plugins/kotlin"))
include 'scala'
project(":scala").projectDir = (new File(rootProject.projectDir, "plugins/scala"))
[
'idea-not-null',
'kotlin',
'scala'
].each {
include it
project(":$it").projectDir = new File(rootProject.projectDir, "plugins/$it")
}