-
-
Notifications
You must be signed in to change notification settings - Fork 5
Update to Gradle 9, Java 17, JGit 7, and other dependencies #41
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
base: main
Are you sure you want to change the base?
Changes from all commits
8f87284
4869975
17d199b
e208f39
6832f09
ddd7d3e
038f512
10d24ca
dbfe1b9
fe3cf45
4d2d8f0
32ce0c7
8d8d9cf
f9807a2
6190161
7d56e1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| gdi_version=1.0.15 | ||
| gdi_version=2.0.0 | ||
|
|
||
| org.gradle.configuration-cache=true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| import org.gradle.api.tasks.TaskAction; | ||
| import org.gradle.api.tasks.options.Option; | ||
| import org.gradle.jvm.toolchain.JavaLanguageVersion; | ||
| import org.gradle.work.DisableCachingByDefault; | ||
|
|
||
| import java.io.File; | ||
| import java.io.FileOutputStream; | ||
|
|
@@ -27,9 +28,10 @@ | |
| import java.util.List; | ||
| import java.util.zip.ZipEntry; | ||
|
|
||
| @DisableCachingByDefault(because = "Task deletes its output directory") | ||
| public abstract class CIConfigExtractionTask extends DefaultTask { | ||
| private final String templateZipName, targetDirName; | ||
| protected CIConfigExtractionTask(String templateZipName, String targetDirName) { | ||
| this.templateZipName = templateZipName; | ||
| this.targetDirName = targetDirName; | ||
| getDestination().convention(getProject().getRootProject().getLayout().getProjectDirectory().dir(getProject().provider(() -> "./"))); | ||
|
|
@@ -38,7 +40,7 @@ | |
| } | ||
|
|
||
| @TaskAction | ||
| public void run() throws Exception { | ||
| //Get the destination directory (by default the current root project directory) | ||
| final File destDir = getDestination().getAsFile().get(); | ||
| //Grab the target directory, to check if it exists. | ||
|
|
@@ -65,11 +67,11 @@ | |
| extractZip(fileZip, destDir); | ||
| } | ||
|
|
||
| protected abstract void extractZip(String fileZip, File destDir) throws Exception; | ||
|
|
||
| @InputDirectory | ||
| @PathSensitive(PathSensitivity.NONE) | ||
| public abstract DirectoryProperty getDestination(); | ||
|
|
||
| /** | ||
| * Creates a new file or directory. | ||
|
|
@@ -78,7 +80,7 @@ | |
| * @param zipEntry The entry in the .teamcity.zip file. | ||
| * @return The new file or directory. | ||
| */ | ||
| protected static File newFile(File destinationDir, ZipEntry zipEntry) throws Exception { | ||
|
Check warning on line 83 in src/main/groovy/net/neoforged/gradleutils/tasks/CIConfigExtractionTask.java
|
||
| File destFile = new File(destinationDir, zipEntry.getName()); | ||
|
|
||
| String destDirPath = destinationDir.getCanonicalPath(); | ||
|
|
@@ -91,7 +93,7 @@ | |
| return destFile; | ||
| } | ||
|
|
||
| protected String determineJDKVersion() { | ||
| if (getProject().getExtensions().findByType(JavaPluginExtension.class) == null) { | ||
| getProject().getLogger().warn("Could not find the Java extension, falling back to JDK 8."); | ||
| return "8"; | ||
|
|
@@ -135,7 +137,7 @@ | |
| private boolean deleteExisting; | ||
|
|
||
| @Input | ||
| public boolean getDeleteExisting() { | ||
| return this.deleteExisting; | ||
| } | ||
|
|
||
|
|
@@ -147,7 +149,7 @@ | |
| /** | ||
| * Finds the most common prefix of all {@code groups}. | ||
| */ | ||
| protected static String findCommonPrefix(List<String> groups) { | ||
|
Check warning on line 152 in src/main/groovy/net/neoforged/gradleutils/tasks/CIConfigExtractionTask.java
|
||
| if (groups.isEmpty()) { | ||
| return ""; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.