forked from gradle/declarative-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gradle:main' into main
- Loading branch information
Showing
22 changed files
with
211 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
org.gradle.parallel=true | ||
org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m | ||
org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=1g | ||
android.useAndroidX=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#This file is generated by updateDaemonJvm | ||
toolchainVersion=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,9 +43,9 @@ balanced-match@^1.0.0: | |
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== | ||
|
||
binary-extensions@^2.0.0: | ||
version "2.2.0" | ||
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" | ||
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== | ||
version "2.3.0" | ||
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" | ||
integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== | ||
|
||
brace-expansion@^1.1.7: | ||
version "1.1.11" | ||
|
@@ -63,11 +63,11 @@ brace-expansion@^2.0.1: | |
balanced-match "^1.0.0" | ||
|
||
braces@~3.0.2: | ||
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" | ||
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== | ||
version "3.0.3" | ||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" | ||
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== | ||
dependencies: | ||
fill-range "^7.0.1" | ||
fill-range "^7.1.1" | ||
|
||
[email protected]: | ||
version "1.3.1" | ||
|
@@ -156,19 +156,19 @@ emoji-regex@^8.0.0: | |
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== | ||
|
||
escalade@^3.1.1: | ||
version "3.1.2" | ||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" | ||
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" | ||
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== | ||
|
||
[email protected]: | ||
version "4.0.0" | ||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" | ||
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== | ||
|
||
fill-range@^7.0.1: | ||
version "7.0.1" | ||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" | ||
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== | ||
fill-range@^7.1.1: | ||
version "7.1.1" | ||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" | ||
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== | ||
dependencies: | ||
to-regex-range "^5.0.1" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
.../src/main/resources/META-INF/services/org.gradle.buildinit.projectspecs.InitProjectSource
This file was deleted.
Oops, something went wrong.
53 changes: 27 additions & 26 deletions
53
...in-common/src/main/java/org/gradle/api/experimental/buildinit/StaticProjectGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
package org.gradle.api.experimental.buildinit; | ||
|
||
import org.gradle.api.file.Directory; | ||
import org.gradle.buildinit.projectspecs.InitProjectConfig; | ||
//import org.gradle.api.file.Directory; | ||
//import org.gradle.buildinit.projectspecs.InitProjectConfig; | ||
import org.gradle.buildinit.projectspecs.InitProjectGenerator; | ||
import org.gradle.util.ResourceLoader; | ||
//import org.gradle.util.ResourceLoader; | ||
|
||
/** | ||
* An {@link InitProjectGenerator} that generates a project from a static template packaged | ||
* as resources files in the {@link #TEMPLATES_ROOT} directory. | ||
*/ | ||
///** | ||
// * An {@link InitProjectGenerator} that generates a project from a static template packaged | ||
// * as resources files in the {@link #TEMPLATES_ROOT} directory. | ||
// */ | ||
@SuppressWarnings("UnstableApiUsage") | ||
public abstract class StaticProjectGenerator implements InitProjectGenerator { | ||
private static final String TEMPLATES_ROOT = "templates"; | ||
|
||
@Override | ||
public void generate(InitProjectConfig config, Directory projectDir) { | ||
if (!(config.getProjectSpec() instanceof StaticProjectSpec projectSpec)) { | ||
throw new IllegalArgumentException("Unknown project type: " + config.getProjectSpec().getDisplayName() + " (" + config.getProjectSpec().getClass().getName() + ")"); | ||
} | ||
|
||
String templatePath = TEMPLATES_ROOT + "/" + projectSpec.getTemplatePath(); | ||
ResourceLoader resourceLoader = new ResourceLoader(); | ||
|
||
try { | ||
resourceLoader.extractDirectoryFromResources(templatePath, projectDir.getAsFile()); | ||
} catch (Exception e) { | ||
throw new RuntimeException("Error extracting resources for: '" + projectSpec.getDisplayName() + "' from: '" + templatePath + "'!", e); | ||
} | ||
} | ||
} | ||
public abstract class StaticProjectGenerator {} | ||
//implements InitProjectGenerator { | ||
// private static final String TEMPLATES_ROOT = "templates"; | ||
// | ||
// @Override | ||
// public void generate(InitProjectConfig config, Directory projectDir) { | ||
// if (!(config.getProjectSpec() instanceof StaticProjectSpec projectSpec)) { | ||
// throw new IllegalArgumentException("Unknown project type: " + config.getProjectSpec().getDisplayName() + " (" + config.getProjectSpec().getClass().getName() + ")"); | ||
// } | ||
// | ||
// String templatePath = TEMPLATES_ROOT + "/" + projectSpec.getTemplatePath(); | ||
// ResourceLoader resourceLoader = new ResourceLoader(); | ||
// | ||
// try { | ||
// resourceLoader.extractDirectoryFromResources(templatePath, projectDir.getAsFile()); | ||
// } catch (Exception e) { | ||
// throw new RuntimeException("Error extracting resources for: '" + projectSpec.getDisplayName() + "' from: '" + templatePath + "'!", e); | ||
// } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 17 additions & 16 deletions
33
...ugin/plugin-jvm/src/main/java/org/gradle/api/experimental/buildinit/JVMProjectSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package org.gradle.api.experimental.buildinit; | ||
|
||
import java.util.List; | ||
//import java.util.List; | ||
|
||
import org.gradle.buildinit.projectspecs.InitProjectGenerator; | ||
import org.gradle.buildinit.projectspecs.InitProjectSpec; | ||
//import org.gradle.buildinit.projectspecs.InitProjectGenerator; | ||
//import org.gradle.buildinit.projectspecs.InitProjectSpec; | ||
import org.gradle.buildinit.projectspecs.InitProjectSource; | ||
|
||
/** | ||
* A {@link InitProjectSource} of project specifications for JVM projects. | ||
*/ | ||
@SuppressWarnings("UnstableApiUsage") | ||
public final class JVMProjectSource implements InitProjectSource { | ||
@Override | ||
public List<InitProjectSpec> getProjectSpecs() { | ||
return List.of( | ||
new StaticProjectSpec("java-application", "Declarative Java Application Project") | ||
); | ||
} | ||
|
||
@Override | ||
public Class<? extends InitProjectGenerator> getProjectGenerator() { | ||
return StaticProjectGenerator.class; | ||
} | ||
} | ||
public final class JVMProjectSource {} | ||
//implements InitProjectSource { | ||
// @Override | ||
// public List<InitProjectSpec> getProjectSpecs() { | ||
// return List.of( | ||
// new StaticProjectSpec("java-application", "Declarative Java Application Project") | ||
// ); | ||
// } | ||
// | ||
// @Override | ||
// public Class<? extends InitProjectGenerator> getProjectGenerator() { | ||
// return StaticProjectGenerator.class; | ||
// } | ||
//} |
1 change: 0 additions & 1 deletion
1
.../src/main/resources/META-INF/services/org.gradle.buildinit.projectspecs.InitProjectSource
This file was deleted.
Oops, something went wrong.
33 changes: 17 additions & 16 deletions
33
...ugin/plugin-kmp/src/main/java/org/gradle/api/experimental/buildinit/KMPProjectSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package org.gradle.api.experimental.buildinit; | ||
|
||
import org.gradle.buildinit.projectspecs.InitProjectGenerator; | ||
//import org.gradle.buildinit.projectspecs.InitProjectGenerator; | ||
import org.gradle.buildinit.projectspecs.InitProjectSource; | ||
import org.gradle.buildinit.projectspecs.InitProjectSpec; | ||
//import org.gradle.buildinit.projectspecs.InitProjectSpec; | ||
|
||
import java.util.List; | ||
//import java.util.List; | ||
|
||
/** | ||
* A {@link InitProjectSource} of project specifications for Kotlin (JVM) projects. | ||
*/ | ||
@SuppressWarnings("UnstableApiUsage") | ||
public final class KMPProjectSource implements InitProjectSource{ | ||
@Override | ||
public List<InitProjectSpec> getProjectSpecs() { | ||
return List.of( | ||
new StaticProjectSpec("kotlin-application", "Declarative Kotlin (JVM) Application Project") | ||
); | ||
} | ||
|
||
@Override | ||
public Class<? extends InitProjectGenerator> getProjectGenerator() { | ||
return StaticProjectGenerator.class; | ||
} | ||
} | ||
public final class KMPProjectSource {} | ||
// implements InitProjectSource { | ||
// @Override | ||
// public List<InitProjectSpec> getProjectSpecs() { | ||
// return List.of( | ||
// new StaticProjectSpec("kotlin-application", "Declarative Kotlin (JVM) Application Project") | ||
// ); | ||
// } | ||
// | ||
// @Override | ||
// public Class<? extends InitProjectGenerator> getProjectGenerator() { | ||
// return StaticProjectGenerator.class; | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.