diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 3ee362509..000000000 --- a/build.gradle +++ /dev/null @@ -1,380 +0,0 @@ -import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradle.TestFrameworkType - -plugins { - id "org.jetbrains.intellij.platform" version "2.0.1" - id "org.jetbrains.kotlin.jvm" version "1.9.24" - id "de.undercouch.download" version "4.1.2" - id 'com.adarshr.test-logger' version '4.0.0' -} - -apply plugin: "org.jetbrains.intellij.platform" - -ext { - cachePath = "${rootDir}/cache" - - elixirPath = "${cachePath}/elixir-${elixirVersion}" - - quoterVersion = "2.1.0" - - quoterUnzippedPath = "${cachePath}/elixir-${elixirVersion}-intellij_elixir-${quoterVersion}" - quoterReleasePath = "${quoterUnzippedPath}/_build/dev/rel/intellij_elixir" - quoterExe = "${quoterReleasePath}/bin/intellij_elixir" - quoterZipPath = "${cachePath}/intellij_elixir-${quoterVersion}.zip" - quoterZipRootPath = "${cachePath}/intellij_elixir-${quoterVersion}" - - if (project.hasProperty("isRelease") && isRelease) { - versionSuffix = "" - channel = "default" - } else { - def date = new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("UTC")) - versionSuffix = "-pre+$date" - channel = "canary" - } - - version "$pluginVersion$versionSuffix" -} - -allprojects { - apply plugin: 'java' - sourceCompatibility = javaVersion - targetCompatibility = javaVersion - tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } -} -subprojects { - apply plugin: 'org.jetbrains.intellij.platform.module' - repositories { - mavenCentral() - intellijPlatform { - defaultRepositories() - } - } - dependencies { - testImplementation 'junit:junit:4.13.2' - testImplementation "org.opentest4j:opentest4j:1.3.0" - - intellijPlatform { - create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) - - bundledPlugins providers.gradleProperty("platformBundledPlugins").map { it.split(',').toList() } - plugins providers.gradleProperty("platformPlugins").map { it.split(',').toList() } - - instrumentationTools() - pluginVerifier() - zipSigner() - testFramework(TestFrameworkType.Platform.INSTANCE) - testFramework(TestFrameworkType.Plugin.Java.INSTANCE) - } - } - sourceSets { - main { - java.srcDirs 'src' - resources.srcDirs 'resources' - } - test { - java.srcDir 'tests' - } - } - -} -sourceSets { - main { - java.srcDirs 'src', 'gen' - resources.srcDirs 'resources' - } - test { - java.srcDir 'tests' - } -} -intellijPlatform { - pluginConfiguration { - def stripTag = { text, tag -> text.replace("<${tag}>", "").replace("", "") } - def bodyInnerHTML = { path -> - stripTag(stripTag(file(path).text, "html"), "body") - } - - id = providers.gradleProperty("pluginGroup") - name = providers.gradleProperty("pluginName") - version = providers.gradleProperty("pluginVersion") - changeNotes.set(bodyInnerHTML("resources/META-INF/changelog.html")) - description.set(bodyInnerHTML("resources/META-INF/description.html")) - - ideaVersion { - sinceBuild = providers.gradleProperty("pluginSinceBuild") - untilBuild = providers.gradleProperty("pluginUntilBuild") - } - vendor { - name = providers.gradleProperty("vendorName") - email = providers.gradleProperty("vendorEmail") - url = providers.gradleProperty("pluginRepositoryUrl") - } - } - - publishPlugin { - token = provider { - System.getenv("JET_BRAINS_MARKETPLACE_TOKEN") - } - channels = publishChannels.split(',').toList() - archiveFile = layout.buildDirectory.file("distributions/${System.getenv("ASSET_NAME")}") - } - pluginVerification { - ides { - ide(IntelliJPlatformType.IntellijIdeaCommunity, "2024.2.0.1") - } - } -} -apply plugin: "kotlin" - -//noinspection GroovyAssignabilityCheck,GrUnresolvedAccess -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - //noinspection GrUnresolvedAccess - kotlinOptions { - apiVersion = "1.7" - jvmTarget = "21" - freeCompilerArgs = ["-Xjvm-default=all"] - } -} - -def compilationPackages = ['org/intellij/elixir/build/**', 'org/intellij/elixir/jps/**'] - -test { - environment "ELIXIR_LANG_ELIXIR_PATH", elixirPath - environment "ELIXIR_EBIN_DIRECTORY", "${elixirPath}/lib/elixir/ebin/" - environment "ELIXIR_VERSION", elixirVersion - setScanForTestClasses(false) - include("**/Issue*.class") - include("**/*Test.class") - include("**/*TestCase.class") - useJUnit { - exclude compilationPackages - } - testLogging { - exceptionFormat = 'full' - } -} - -intellijPlatformTesting { - // Get the list of platforms from gradle.properties - def platformsList = providers.gradleProperty("platformsList").get().split(",") - - // Use providers.gradleProperty to get the 'runIdePlugins' property - def runIdePluginsProperty = providers.gradleProperty("runIdePlugins").getOrElse("") - def runIdePluginsList = runIdePluginsProperty.split(",") - - platformsList.each { platform -> - runIde.create("run${platform}") { - type = IntelliJPlatformType."${platform}" - version = providers.gradleProperty("platformVersion${platform}").get() - prepareSandboxTask { - sandboxDirectory = project.layout.buildDirectory.dir("${platform.toLowerCase()}-sandbox") - } - - // if runIdePluginsList is not empty, set the plugins - if (runIdePluginsList.size() > 0) { - plugins { - // Apply each plugin from the 'runIdePluginsList' - runIdePluginsList.each { plugin -> - plugins(plugin.trim()) - } - } - } - } - } -} - -task testCompilation(type: Test, group: 'Verification', dependsOn: [classes, testClasses]) { - useJUnit { - include compilationPackages - } - testLogging { - exceptionFormat = 'full' - } -} - -repositories { - maven { url 'https://maven-central.storage.googleapis.com' } - mavenCentral() - intellijPlatform { - defaultRepositories() - } -} - -dependencies { - intellijPlatform { - create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) - - bundledPlugins providers.gradleProperty("platformBundledPlugins").map { it.split(',').toList() } - plugins providers.gradleProperty("platformPlugins").map { it.split(',').toList() } - - instrumentationTools() - pluginVerifier() - zipSigner() - testFramework(TestFrameworkType.Platform.INSTANCE) - testFramework(TestFrameworkType.Plugin.Java.INSTANCE) - } - - implementation project(':jps-builder') - implementation project(':jps-shared') - implementation files('lib/OtpErlang.jar') - implementation group: 'commons-io', name: 'commons-io', version: '2.5' - - testImplementation 'junit:junit:4.13.2' - testImplementation "org.opentest4j:opentest4j:1.3.0" - - testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.2.9' - testImplementation group: 'org.objenesis', name: 'objenesis', version: '2.4' -} -compileJava { - dependsOn ':jps-shared:composedJar' - dependsOn ':jps-builder:composedJar' -} - -apply plugin: 'idea' -idea { - project { - jdkName = javaVersion - languageLevel = javaVersion - } - module { - generatedSourceDirs += file('gen') - } -} - -task getElixir { - doLast { - def folder = new File(elixirPath) - - if (!folder.isDirectory() || folder.list().size() == 0) { - download { - src "https://github.com/elixir-lang/elixir/archive/v${elixirVersion}.zip" - dest "${rootDir}/cache/Elixir.${elixirVersion}.zip" - overwrite false - } - } - - def binFolder = new File("${elixirPath}/bin") - if (!binFolder.isDirectory() || folder.list().size() == 0) { - copy { - from zipTree("${rootDir}/cache/Elixir.${elixirVersion}.zip") - into "${rootDir}/cache/" - } - - exec { - workingDir elixirPath - commandLine "make" - } - } - } -} - -task getQuoter { - doLast { - download { - src "https://github.com/KronicDeth/intellij_elixir/archive/v${quoterVersion}.zip" - dest quoterZipPath - overwrite false - } - - def folder = new File(quoterUnzippedPath) - if (!folder.isDirectory() || folder.list().size() == 0) { - copy { - from zipTree(quoterZipPath) - into cachePath - } - - def quoterZipRootFile = new File(quoterZipRootPath) - - quoterZipRootFile.renameTo(quoterUnzippedPath) - } - } -} - -task getQuoterDeps(dependsOn: getQuoter) { - doLast { - exec { - workingDir quoterUnzippedPath - commandLine 'mix', 'do', 'local.rebar', '--force,', 'local.hex', '--force,', 'deps.get' - // standardOutput = System.out - // errorOutput = System.err - } - } -} - -task releaseQuoter(dependsOn: getQuoterDeps) { - doLast { - def file = new File(quoterExe) - - if (!file.canExecute()) { - exec { - workingDir quoterUnzippedPath - commandLine 'mix', 'do', 'local.rebar', '--force,', 'local.hex', '--force,', 'deps.get,', 'release' - // standardOutput = System.out - // errorOutput = System.err - } - } - } -} - -compileTestJava { - dependsOn ":jps-builder:composedJar" - dependsOn ":jps-shared:composedJar" - dependsOn getElixir - dependsOn getQuoter -} - -task runQuoter(type: Exec, dependsOn: releaseQuoter) { - environment "RELEASE_COOKIE", "intellij_elixir" - environment "RELEASE_DISTRIBUTION", "name" - environment "RELEASE_NAME", "intellij_elixir@127.0.0.1" - executable quoterExe - args "daemon" -} - -task stopQuoter(type: Exec, dependsOn: releaseQuoter) { - environment "RELEASE_COOKIE", "intellij_elixir" - environment "RELEASE_DISTRIBUTION", "name" - environment "RELEASE_NAME", "intellij_elixir@127.0.0.1" - executable quoterExe - args "stop" -} - -runIde { - systemProperty "idea.log.debug.categories", "org.elixir_lang=TRACE" - // When wanting to disable EDT slow assertion.. - // systemProperty "ide.slow.operations.assertion", "true" - - // -Didea.debug.mode=true: - // This enables debug mode for IntelliJ IDEA. It can be useful when developing plugins to get more detailed logging and debugging information. - // -Didea.is.internal=true: - // This flag indicates that the plugin is running in an internal mode, which may enable additional features or logging that are typically only available to IntelliJ developers. - // -Dlog4j2.debug=true: - // This enables debug logging for Log4j 2, which is the logging framework used by IntelliJ IDEA. It can help in troubleshooting logging-related issues in your plugin. - // -Dlogger.org=TRACE: - // This sets the logging level for the "org" package to TRACE, which is the most verbose logging level. This can be useful for detailed logging of plugin activities. - // -XX:+AllowEnhancedClassRedefinition: - // This is a JVM flag that allows for more flexible class redefinition during runtime. It can be beneficial for hot-swapping code changes without restarting the IDE. - // -Didea.ProcessCanceledException=disabled: - //This disables the throwing of ProcessCanceledException, which is typically used to cancel long-running processes in IntelliJ IDEA. Disabling it can be useful in certain debugging scenarios. - jvmArgs "-Didea.debug.mode=true", "-XX:+AllowEnhancedClassRedefinition", "-Didea.is.internal=true", "-Dlog4j2.debug=true", "-Dlogger.org=TRACE", "-Didea.ProcessCanceledException=disabled" - maxHeapSize = "7g" - // get from runIdeWorkingDirectory - if (project.hasProperty("runIdeWorkingDirectory") && !project.property("runIdeWorkingDirectory").isEmpty()) { - workingDir = file(project.property("runIdeWorkingDirectory")) - } -} - -test { - dependsOn runQuoter - finalizedBy stopQuoter -} - -apply plugin: 'idea' -idea { - project { - jdkName = javaVersion - languageLevel = javaVersion - } - module { - generatedSourceDirs += file('gen') - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..913164db9 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,393 @@ +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.TestFrameworkType +import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask +import java.text.SimpleDateFormat +import java.util.* +import de.undercouch.gradle.tasks.download.Download + +plugins { + id("org.jetbrains.intellij.platform") version "2.0.1" + id("org.jetbrains.kotlin.jvm") version "1.9.24" + id("de.undercouch.download") version "4.1.2" + id("com.adarshr.test-logger") version "4.0.0" +} + +// Define paths and versions using properties from gradle.properties +val cachePath by extra("${rootDir}/cache") +val elixirVersion: String by project +val elixirPath by extra("${cachePath}/elixir-$elixirVersion") +val quoterVersion by extra("2.1.0") +val quoterUnzippedPath by extra("${cachePath}/elixir-$elixirVersion-intellij_elixir-$quoterVersion") +val quoterReleasePath by extra("$quoterUnzippedPath/_build/dev/rel/intellij_elixir") +val quoterExe by extra("$quoterReleasePath/bin/intellij_elixir") +val quoterZipPath by extra("$cachePath/intellij_elixir-$quoterVersion.zip") +val quoterZipRootPath by extra("$cachePath/intellij_elixir-$quoterVersion") + +// Determine if this is a release build +val isRelease = project.hasProperty("isRelease") && project.property("isRelease") as Boolean +val versionSuffix = if (isRelease) "" else "-pre+${SimpleDateFormat("yyyyMMddHHmmss").format(Date())}" +val channel = if (isRelease) "default" else "canary" + +// Function to get environment variables +fun environment(key: String) = providers.environmentVariable(key) + +// Set the version of the plugin +version = "${project.property("pluginVersion")}$versionSuffix" + +allprojects { + apply(plugin = "java") + tasks.withType { + options.encoding = "UTF-8" + } +} + +subprojects { + apply(plugin = "org.jetbrains.intellij.platform.module") + repositories { + mavenCentral() + intellijPlatform { + defaultRepositories() + } + } + dependencies { + testImplementation("junit:junit:4.13.2") + testImplementation("org.opentest4j:opentest4j:1.3.0") + + intellijPlatform { + create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) + + bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',').toList() }) + plugins(providers.gradleProperty("platformPlugins").map { it.split(',').toList() }) + + instrumentationTools() + pluginVerifier() + zipSigner() + testFramework(TestFrameworkType.Platform) + testFramework(TestFrameworkType.Plugin.Java) + } + } + sourceSets { + main { + java.srcDirs("src") + resources.srcDirs("resources") + } + test { + java.srcDir("tests") + } + } +} + +sourceSets { + main { + java.srcDirs("src", "gen") + resources.srcDirs("resources") + } + test { + java.srcDir("tests") + } +} + +intellijPlatform { + pluginConfiguration { + val stripTag = { text: String, tag: String -> text.replace("<$tag>", "").replace("", "") } + val bodyInnerHTML = { path: String -> + stripTag(stripTag(file(path).readText(), "html"), "body") + } + + id = providers.gradleProperty("pluginGroup") + name = providers.gradleProperty("pluginName") + version = providers.gradleProperty("pluginVersion") + changeNotes.set(bodyInnerHTML("resources/META-INF/changelog.html")) + description.set(bodyInnerHTML("resources/META-INF/description.html")) + + ideaVersion { + sinceBuild = providers.gradleProperty("pluginSinceBuild") + untilBuild = providers.gradleProperty("pluginUntilBuild") + } + vendor { + name = providers.gradleProperty("vendorName") + email = providers.gradleProperty("vendorEmail") + url = providers.gradleProperty("pluginRepositoryUrl") + } + } + publishing { + token = environment("PUBLISH_TOKEN") + channels = providers.gradleProperty("pluginVersion").map { + listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) + } + } + pluginVerification { + ides { + ide(IntelliJPlatformType.IntellijIdeaCommunity, "2024.2.0.1") + } + } +} + +tasks.withType().all { + kotlinOptions { + apiVersion = "1.7" + jvmTarget = "21" + freeCompilerArgs = listOf("-Xjvm-default=all") + } +} + +val compilationPackages = listOf("org/intellij/elixir/build/**", "org/intellij/elixir/jps/**") + +tasks.test { + environment("ELIXIR_LANG_ELIXIR_PATH", elixirPath) + environment("ELIXIR_EBIN_DIRECTORY", "$elixirPath/lib/elixir/ebin/") + environment("ELIXIR_VERSION", elixirVersion) + isScanForTestClasses = false + include("**/Issue*.class") + include("**/*Test.class") + include("**/*TestCase.class") + useJUnit { + exclude(compilationPackages) + } + testLogging { + exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL + } +} + +intellijPlatformTesting { + // Get the list of platforms from gradle.properties + val platformsList = providers.gradleProperty("platformsList").get().split(",") + + // Use providers.gradleProperty to get the 'runIdePlugins' property + val runIdePluginsProperty = providers.gradleProperty("runIdePlugins").getOrElse("") + val runIdePluginsList = runIdePluginsProperty.split(",") + + platformsList.forEach { platform -> + runIde.create("run$platform") { + type = IntelliJPlatformType.valueOf(platform) + version = providers.gradleProperty("platformVersion$platform").get() + prepareSandboxTask { + sandboxDirectory = project.layout.buildDirectory.dir("${platform.lowercase()}-sandbox") + } + + // if runIdePluginsList is not empty, set the plugins + if (runIdePluginsList.isNotEmpty()) { + // Apply each plugin from the 'runIdePluginsList' + // @todo can we move this to the runIde task? + plugins { + runIdePluginsList.forEach { plugin -> + plugins(plugin.trim()) + } + } + } + } + } +} + +tasks.register("downloadElixir") { + src("https://github.com/elixir-lang/elixir/archive/v${project.properties["elixirVersion"]}.zip") + dest("${rootDir}/cache/Elixir.${project.properties["elixirVersion"]}.zip") + overwrite(false) +} + +tasks.register("testCompilation") { + group = "Verification" + dependsOn("classes", "testClasses") + useJUnit { + include(compilationPackages) + } + testLogging { + exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL + } +} + +repositories { + maven { url = uri("https://maven-central.storage.googleapis.com") } + mavenCentral() + intellijPlatform { + defaultRepositories() + } +} + +dependencies { + intellijPlatform { + create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) + + bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',').toList() }) + plugins(providers.gradleProperty("platformPlugins").map { it.split(',').toList() }) + + instrumentationTools() + pluginVerifier() + zipSigner() + testFramework(TestFrameworkType.Platform) + testFramework(TestFrameworkType.Plugin.Java) + } + + implementation(project(":jps-builder")) + implementation(project(":jps-shared")) + implementation(files("lib/OtpErlang.jar")) + implementation("commons-io:commons-io:2.16.1") + + testImplementation("junit:junit:4.13.2") + testImplementation("org.opentest4j:opentest4j:1.3.0") + + testImplementation("org.mockito:mockito-core:2.2.9") + testImplementation("org.objenesis:objenesis:2.4") +} + +tasks.compileJava { + dependsOn(":jps-shared:composedJar") + dependsOn(":jps-builder:composedJar") +} + +apply(plugin = "idea") + +idea { + project { + jdkName = providers.gradleProperty("javaVersion").get() + languageLevel = providers.gradleProperty("javaVersion").get() + .let { org.gradle.plugins.ide.idea.model.IdeaLanguageLevel(it) } + } + module { + generatedSourceDirs.add(file("gen")) + } +} + +tasks.register("getElixir") { + dependsOn("downloadElixir") + doLast { + val folder = File(elixirPath) + + if (!folder.isDirectory || folder.list().isEmpty()) { + tasks.named("download") { + src("https://github.com/elixir-lang/elixir/archive/v$elixirVersion.zip") + dest("$rootDir/cache/Elixir.$elixirVersion.zip") + overwrite(false) + } + } + + val binFolder = File("$elixirPath/bin") + if (!binFolder.isDirectory || folder.list().isEmpty()) { + copy { + from(zipTree("$rootDir/cache/Elixir.$elixirVersion.zip")) + into("$rootDir/cache/") + } + + exec { + workingDir = file(elixirPath) + commandLine("make") + } + } + } +} + +tasks.register("getQuoter") { + doLast { + tasks.named("download") { + src("https://github.com/KronicDeth/intellij_elixir/archive/v$quoterVersion.zip") + dest(quoterZipPath) + overwrite(false) + } + + val folder = File(quoterUnzippedPath) + if (!folder.isDirectory || folder.list().isEmpty()) { + copy { + from(zipTree(quoterZipPath)) + into(cachePath) + } + + val quoterZipRootFile = File(quoterZipRootPath) + + quoterZipRootFile.renameTo(folder) + } + } +} + +tasks.register("getQuoterDeps") { + dependsOn("getQuoter") + doLast { + exec { + workingDir = file(quoterUnzippedPath) + commandLine("mix", "do", "local.rebar", "--force,", "local.hex", "--force,", "deps.get") + } + } +} + +tasks.register("releaseQuoter") { + dependsOn("getQuoterDeps") + doLast { + val file = File(quoterExe) + + if (!file.canExecute()) { + exec { + workingDir = file(quoterUnzippedPath) + commandLine("mix", "do", "local.rebar", "--force,", "local.hex", "--force,", "deps.get,", "release") + } + } + } +} + +tasks.compileTestJava { + dependsOn(":jps-builder:composedJar") + dependsOn(":jps-shared:composedJar") + dependsOn("getElixir") + dependsOn("getQuoter") +} + +tasks.register("runQuoter") { + dependsOn("releaseQuoter") + environment("RELEASE_COOKIE", "intellij_elixir") + environment("RELEASE_DISTRIBUTION", "name") + environment("RELEASE_NAME", "intellij_elixir@127.0.0.1") + executable = quoterExe + args("daemon") +} + +tasks.register("stopQuoter") { + dependsOn("releaseQuoter") + environment("RELEASE_COOKIE", "intellij_elixir") + environment("RELEASE_DISTRIBUTION", "name") + environment("RELEASE_NAME", "intellij_elixir@127.0.0.1") + executable = quoterExe + args("stop") +} + +tasks.test { + dependsOn("runQuoter") + finalizedBy("stopQuoter") +} + +apply(plugin = "idea") + +idea { + project { + jdkName = providers.gradleProperty("javaVersion").get() + languageLevel = providers.gradleProperty("javaVersion").get() + .let { org.gradle.plugins.ide.idea.model.IdeaLanguageLevel(it) } + } + module { + generatedSourceDirs.add(file("gen")) + } +} + +tasks { + withType { + jvmArgumentProviders += CommandLineArgumentProvider { + listOf( + "-Didea.debug.mode=true", + "-XX:+AllowEnhancedClassRedefinition", + "-Didea.is.internal=true", + "-Dlog4j2.debug=true", + "-Dlogger.org.elixir_lang=TRACE", + "-Didea.ProcessCanceledException=disabled" + ) + } + systemProperty("idea.log.debug.categories", "org.elixir_lang=TRACE") + maxHeapSize = "7g" + if (project.hasProperty("runIdeWorkingDirectory") && project.property("runIdeWorkingDirectory").toString() + .isNotEmpty() + ) { + workingDir = project.property("runIdeWorkingDirectory")?.let { file(it) }!! + } + } + + compileKotlin { + kotlinOptions.jvmTarget = providers.gradleProperty("javaVersion").get() + kotlinOptions.freeCompilerArgs = listOf("-Xjvm-default=all") + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930..9355b4155 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/jps-builder/build.gradle b/jps-builder/build.gradle deleted file mode 100644 index 1d22d5d1d..000000000 --- a/jps-builder/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -jar.archiveFileName = "jps-builder.jar" - -def compilationPackages = ['org/intellij/elixir/build/**', 'org/intellij/elixir/jps/**'] - -compileTestJava { - dependsOn(":jps-shared:composedJar") -} -compileJava { - dependsOn(":jps-shared:composedJar") -} - -// Ensuring the necessary tasks are executed before tests -test { - dependsOn ':getElixir' - dependsOn ':getQuoter' - dependsOn ':runQuoter' - - environment "ELIXIR_LANG_ELIXIR_PATH", elixirPath - environment "ELIXIR_EBIN_DIRECTORY", "${elixirPath}/lib/elixir/ebin/" - environment "ELIXIR_VERSION", elixirVersion - useJUnit { - exclude compilationPackages - } - testLogging { - exceptionFormat = 'full' - } - - finalizedBy ':stopQuoter' // Ensure stopQuoter runs after tests -} - -dependencies { - implementation project(':jps-shared') -} \ No newline at end of file diff --git a/jps-builder/build.gradle.kts b/jps-builder/build.gradle.kts new file mode 100644 index 000000000..220033ed1 --- /dev/null +++ b/jps-builder/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + java +} + +tasks.jar { + archiveFileName.set("jps-builder.jar") +} + +val compilationPackages = listOf("org/intellij/elixir/build/**", "org/intellij/elixir/jps/**") + +tasks.compileTestJava { + dependsOn(":jps-shared:composedJar") +} + +tasks.compileJava { + dependsOn(":jps-shared:composedJar") +} + +tasks.test { + dependsOn(":getElixir") + dependsOn(":getQuoter") + dependsOn(":runQuoter") + + environment("ELIXIR_LANG_ELIXIR_PATH", project.rootProject.extra["elixirPath"] as String) + environment("ELIXIR_EBIN_DIRECTORY", "${project.rootProject.extra["elixirPath"]}/lib/elixir/ebin/") + environment("ELIXIR_VERSION", project.rootProject.extra["elixirVersion"] as String) + useJUnit { + exclude(compilationPackages) + } + testLogging { + exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL + } + + finalizedBy(":stopQuoter") +} + +dependencies { + implementation(project(":jps-shared")) +} \ No newline at end of file diff --git a/jps-shared/build.gradle b/jps-shared/build.gradle deleted file mode 100644 index a869b0950..000000000 --- a/jps-shared/build.gradle +++ /dev/null @@ -1,2 +0,0 @@ -jar.archiveFileName = "jps-shared.jar" -testClasses.enabled = false \ No newline at end of file diff --git a/jps-shared/build.gradle.kts b/jps-shared/build.gradle.kts new file mode 100644 index 000000000..0faae6c94 --- /dev/null +++ b/jps-shared/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + java +} + +tasks.jar { + archiveFileName.set("jps-shared.jar") +} + +tasks.withType { + enabled = false +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index fd9da34fc..000000000 --- a/settings.gradle +++ /dev/null @@ -1,6 +0,0 @@ -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' -} -rootProject.name = 'Elixir' -include 'jps-shared' -include 'jps-builder' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..e17b99d85 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + +rootProject.name = "Elixir" + +include("jps-shared") +include("jps-builder") \ No newline at end of file