Skip to content

Commit 164c0e3

Browse files
committed
removing runtime code to add foojay plugin to settings.gradle
1 parent 2b241c1 commit 164c0e3

21 files changed

+7
-34
lines changed

src/test/groovy/io/openliberty/tools/gradle/AbstractIntegrationTest.groovy

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616

1717
package io.openliberty.tools.gradle
1818

19-
import java.io.File
20-
21-
import java.util.List
22-
import java.util.ArrayList
2319

2420
import static org.junit.Assert.*
2521

@@ -28,7 +24,7 @@ import org.gradle.testkit.runner.BuildResult
2824
import org.gradle.testkit.runner.GradleRunner
2925
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
3026
import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE
31-
import org.gradle.api.GradleException
27+
3228
import io.openliberty.tools.common.plugins.util.OSUtil
3329

3430
abstract class AbstractIntegrationTest {
@@ -249,15 +245,6 @@ abstract class AbstractIntegrationTest {
249245
return false;
250246
}
251247

252-
protected static void addToolchainJdkDownloadPluginToSettings(File settingsFile) {
253-
// 1. Define the plugin block to download toolchain jdk
254-
String toolchainPlugin = """plugins {id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'}"""
255-
// 2. Read existing content (if any) and write the new content at the start
256-
String existingContent = settingsFile.exists() ? settingsFile.text : ""
257-
settingsFile.text = toolchainPlugin + existingContent
258-
}
259-
260-
261248
protected static void assertToolchainLogsForTask(BuildResult result, String task, String jdkVersion, File messageLog) {
262249
String consoleLogOutput = result.getOutput()
263250
if (messageLog != null) {

src/test/groovy/io/openliberty/tools/gradle/LibertyApplicationConfigurationIncludeWithToolchainTest.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class LibertyApplicationConfigurationIncludeWithToolchainTest extends AbstractIn
4141
public static void setup() {
4242
createDir(buildDir)
4343
createTestProject(buildDir, resourceDir, buildFilename)
44-
addToolchainJdkDownloadPluginToSettings(new File(buildDir,"settings.gradle"))
4544
try {
4645
//Installing the war built by the other gradle project in the src dir
4746
runTasks(new File(buildDir, 'test-maven-war'), 'publishToMavenLocal')

src/test/groovy/io/openliberty/tools/gradle/LibertyPackage_looseApplication_withToolchainTest.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class LibertyPackage_looseApplication_withToolchainTest extends AbstractIntegrat
3535
createDir(buildDir)
3636
copyBuildFiles(buildFilename, buildDir)
3737
copySettingsFile(resourceDir, buildDir)
38-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, "settings.gradle"))
3938
try {
4039
BuildResult result= runTasksResult(buildDir, 'installLiberty', 'libertyStart', 'libertyStop')
4140
String consoleLogOutput = result.getOutput();

src/test/groovy/io/openliberty/tools/gradle/LibertyToolchainJdk8FailTest.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class LibertyToolchainJdk8FailTest extends AbstractIntegrationTest {
3838
public static void setup() {
3939
createDir(buildDir)
4040
createTestProject(buildDir, resourceDir, buildFilename)
41-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, "settings.gradle"))
4241
try {
4342
runTasks(buildDir, 'installLiberty')
4443
} catch (Exception e) {

src/test/groovy/io/openliberty/tools/gradle/LibertyToolchainTest.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class LibertyToolchainTest extends AbstractIntegrationTest{
3434
public static void setup() {
3535
createDir(buildDir)
3636
createTestProject(buildDir, resourceDir, buildFilename)
37-
addToolchainJdkDownloadPluginToSettings(new File(buildDir,"settings.gradle"))
3837
try {
3938
runTasks(buildDir, 'installLiberty')
4039
} catch (Exception e) {

src/test/groovy/io/openliberty/tools/gradle/TestCompileJSPSource17.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public class TestCompileJSPSource17 extends AbstractIntegrationTest{
3030
public static void setup() {
3131
createDir(buildDir)
3232
createTestProject(buildDir, resourceDir, buildFilename)
33-
// needed to add a plugin to download jdk for toolchain into settings.gradle
34-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, 'settings.gradle'))
3533
runTasks(buildDir, 'installFeature')
3634
runTasks(buildDir, 'compileJsp')
3735
}

src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationToolchainWarningForCustomServerEnvFile.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public class TestLooseApplicationToolchainWarningForCustomServerEnvFile extends
3131
def escapedJavaHome = javaHome.replace("\\", "\\\\")
3232
String toolchainPlugin = "JAVA_HOME=" + escapedJavaHome
3333
serverEnvFile.append(toolchainPlugin)
34-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, "settings.gradle"))
3534
}
3635

3736
@AfterClass

src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationToolchainWarningForJvmOptions.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public class TestLooseApplicationToolchainWarningForJvmOptions extends AbstractI
3131
def escapedJavaHome = javaHome.replace("\\", "\\\\")
3232
String toolchainPlugin = "-Djava.home=" + escapedJavaHome
3333
jvmOptionsFile.append(System.lineSeparator() + toolchainPlugin)
34-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, "settings.gradle"))
3534
}
3635

3736
@AfterClass

src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationToolchainWarningForJvmOptionsInline.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class TestLooseApplicationToolchainWarningForJvmOptionsInline extends Abs
3232
def fileContent = buildFile.text
3333
fileContent = fileContent.replace("REPLACE_JDK_PATH", escapedJavaHome) // Literal replacement
3434
buildFile.text = fileContent
35-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, "settings.gradle"))
3635
}
3736

3837
@AfterClass

src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationToolchainWarningForJvmOptionsProperty.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public class TestLooseApplicationToolchainWarningForJvmOptionsProperty extends A
3030
def javaHome = Paths.get(System.getenv("JAVA_HOME")).toString()
3131
def escapedJavaHome = javaHome.replace("\\", "\\\\")
3232
buildFile.append("liberty.server.jvmOptions=[\"-Djava.home="+escapedJavaHome+"\"]")
33-
addToolchainJdkDownloadPluginToSettings(new File(buildDir, "settings.gradle"))
3433
}
3534

3635
@AfterClass

0 commit comments

Comments
 (0)