Skip to content

Commit

Permalink
Add all remaining properties
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenraven committed Feb 3, 2024
1 parent 7790a6f commit 17b33c1
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 8 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ tasks.wrapper.configure {
distributionType = Wrapper.DistributionType.ALL
}

configurations["functionalTestRuntimeOnly"].extendsFrom(configurations["testRuntimeOnly"])
configurations["functionalTestImplementation"].extendsFrom(configurations["testImplementation"])
configurations["functionalTestAnnotationProcessor"].extendsFrom(configurations["testAnnotationProcessor"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,39 @@ private File getBuildFile() {
return new File(projectDir, "build.gradle");
}

private File getPropertiesFile() {
return new File(projectDir, "gradle.properties");
}

private File getSettingsFile() {
return new File(projectDir, "settings.gradle");
}

private static final String SIMPLE_SETTINGS_FILE = """
plugins {
id('com.gtnewhorizons.gtnhsettingsconvention')
}
""";

private static final String SIMPLE_BUILD_FILE = """
plugins {
id('com.gtnewhorizons.gtnhgradle')
id('com.gtnewhorizons.gtnhconvention')
}
""";

private static final String SIMPLE_PROPERTIES_FILE = """
modName = MyMod
modId = mymodid
modGroup = com.myname.mymodid
enableModernJavaSyntax = true
enableGenericInjection = true
""";

@Test
void canRunRfgTask() throws IOException {
writeString(getSettingsFile(), "");
writeString(getSettingsFile(), SIMPLE_SETTINGS_FILE);
writeString(getBuildFile(), SIMPLE_BUILD_FILE);
writeString(getPropertiesFile(), SIMPLE_PROPERTIES_FILE);

// Run the build
GradleRunner runner = GradleRunner.create()
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/gtnewhorizons/gtnhgradle/GTNHConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.gtnewhorizons.gtnhgradle;

import org.jetbrains.annotations.NotNull;

/** Various useful constants related to GTNH projects. */
@SuppressWarnings("unused")
public class GTNHConstants {

/** URL of the "public" GTNH Maven repository, contains all our and mirrored packages */
public static final @NotNull String GTNH_MAVEN_PUBLIC_REPOSITORY = "https://nexus.gtnewhorizons.com/repository/public/";
/** URL of the "releases" GTNH Maven repository, contains only our mod packages */
public static final @NotNull String GTNH_MAVEN_RELEASES_REPOSITORY = "https://nexus.gtnewhorizons.com/repository/releases/";
/** The current Checkstyle configuration file contents used */
public static final @NotNull String CHECKSTYLE_CONFIG = """
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
<module name="SuppressionCommentFilter"/>
<module name="AvoidStarImport">
<!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
<property name="allowStaticMemberImports" value="true"/>
</module>
</module>
</module>
""";
}
Loading

0 comments on commit 17b33c1

Please sign in to comment.