-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from gradle/tt/prep-0.1.14-for-nia
Comment out init project generation types
- Loading branch information
Showing
17 changed files
with
204 additions
and
139 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
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
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
45 changes: 23 additions & 22 deletions
45
...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. | ||
*/ | ||
@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; | ||
// } | ||
//} |
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.