Skip to content

Commit

Permalink
Update to use the GT Buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers committed Jul 6, 2023
1 parent f144564 commit 3609324
Show file tree
Hide file tree
Showing 9 changed files with 1,173 additions and 254 deletions.
1,143 changes: 957 additions & 186 deletions build.gradle

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//file:noinspection DependencyNotationArgument
// TODO remove when fixed in RFG ^
/*
* Add your dependencies here. Common configurations:
* - implementation("group:name:version:classifier"): if you need this for internal implementation details of the mod.
* Available at compiletime and runtime for your environment.
*
* - compileOnlyApi("g:n:v:c"): if you need this for internal implementation details of the mod.
* Available at compiletime but not runtime for your environment.
*
* - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry
*
* - testCONFIG("g:n:v:c"): replace CONFIG by one of the above, same as above but for the test sources instead of main
*
* You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed.
*
* To add a mod with CurseMaven, replace '("g:n:v:c")' in the above with 'rfg.deobf("curse.maven:project_slug-project_id:file_id")'
* Example: implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4527757")
*
* To shadow a dependency, use 'shadowImplementation'. For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md
*
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {


// Hard Dependencies
// the CCL deobf jar uses very old MCP mappings, making it error at runtime in runClient/runServer
// therefore we manually deobf the regular jar
implementation rfg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848") // CCL 3.2.3.358
// manually deobf the jar to prevent extra configuration for handling obf/deobf separation
implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4527757-sources-4527758")

// Soft Dependencies
implementation "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.684"
implementation rfg.deobf("curse.maven:ctm-267602:2915363") // CTM 1.0.2.31
//implementation rfg.deobf("curse.maven:groovyscript-687577:4487379") // GRS 0.4.6
implementation files("libs/groovyscript-0.4.0.jar")
}
215 changes: 156 additions & 59 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,61 +1,158 @@
# Mod Information
archives_base_name = GregicalityMultiblocks
mc_version = 1.12.2
mod_version = 1.2.3
maven_group = gregicality

## Hard Dependencies
ccl_pid = 242818
ccl_fid = 2779848
gt_pid = 557242
gt_fid = 4527757
gt_sources_fid = 4527758

## Soft Dependencies
jei_version = 4.16.1.302
crt_version = 4.1.20.684
### TOP 1.4.28
top_pid = 245211
top_fid = 2667280
### CTM 1.0.2.31
ctm_pid = 267602
ctm_fid = 2915363
### GRS 0.3.0
# suppress inspection "UnusedProperty"
grs_pid = 687577
# suppress inspection "UnusedProperty"
grs_fid = 4487379

## Mixin Dependencies
mixinbooter_version = 7.0
mixin_version = 0.8.3
asm_debug_version = 5.2
### should use 24.1.1 but 30.0+ has a vulnerability fix
guava_version = 30.0
### should use 2.8.6 but 2.8.9+ has a vulnerability fix
gson_version = 2.8.9

## Test Dependencies
junit_version = 5.9.1
hamcrest_version = 2.2

## Gradle Dependencies
foojay_version = 0.4.0
idea_ext_version = 1.1.7
rfg_version = 1.3.10
java_version = 8

# Deployment
deployment_debug = false

## Dependencies
curseforge_gradle_version = 1.0.+
minotaur_version = 2.7.+

# Gradle Settings (do not rename values)
org.gradle.welcome = never
modName = Gregicality Multiblocks

# This is a case-sensitive string to identify your mod. Convention is to use lower case.
modId = gcym

modGroup = gregicality

# Version of your mod.
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
modVersion = 1.2.3

# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
includeMCVersionJar = false

# The name of your jar when you produce builds, not including any versioning info
modArchivesBaseName = GregicalityMultiblocks

# Will update your build.gradle automatically whenever an update is available
autoUpdateBuildScript = false

minecraftVersion = 1.12.2

# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# Alternatively this can be set with the 'DEV_USERNAME' environment variable.
developmentEnvironmentUserName = Developer

# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
# Using this requires that you use a Java 17 JDK for development.
enableModernJavaSyntax = true

# Generate a class with String fields for the mod id, name and version named with the fields below
generateGradleTokenClass = gregicality.GCYMInternalTags
gradleTokenModId = MODID
gradleTokenModName = MODNAME
gradleTokenVersion = VERSION

# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage =

# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/
# There can be multiple files in a comma-separated list.
# Example value: mymodid_at.cfg,jei_at.cfg
accessTransformersFile =

# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod (meaning that
# there is no class annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false

# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = true

# Adds CurseMaven, Modrinth Maven, BlameJared maven, and some more well-known 1.12.2 repositories
includeWellKnownRepositories = true

# Adds JEI and TheOneProbe to your development environment. Adds them as 'implementation', meaning they will
# be available at compiletime and runtime for your mod (in-game and in-code).
# Overrides the above setting to be always true, as these repositories are needed to fetch the mods
includeCommonDevEnvMods = true


# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = false
# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true


# Publishing to modrinth requires you to set the MODRINTH_API_KEY environment variable to your current modrinth API token.

# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish on Modrinth.
# Alternatively this can be set with the 'MODRINTH_PROJECT_ID' environment variable.
modrinthProjectId = tZiutdLG

# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:jei;optional-project:top;incompatible-project:gregtech
modrinthRelations = required-project:gregtech-ce-unofficial


# Publishing to CurseForge requires you to set the CURSEFORGE_API_KEY environment variable to one of your CurseForge API tokens.

# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
# Alternatively this can be set with the 'CURSEFORGE_PROJECT_ID' environment variable.
curseForgeProjectId = 564858

# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
curseForgeRelations = requiredDependency:codechicken-lib-1-8;requiredDependency:gregtech-ce-unofficial;incompatible:gregtechce

# This project's release type on CurseForge and/or Modrinth
# Alternatively this can be set with the 'RELEASE_TYPE' environment variable.
# Allowed types: release, beta, alpha
releaseType = beta

# Generate a default changelog for releases. Requires git to be installed, as it uses it to generate a changelog of
# commits since the last tagged release.
generateDefaultChangelog = false

# Prevent the source code from being published
noPublishedSources = false


# Publish to a custom maven location. Follows a few rules:
# Group ID can be set with the 'ARTIFACT_GROUP_ID' environment variable, default to 'project.group'
# Artifact ID can be set with the 'ARTIFACT_ID' environment variable, default to 'project.name'
# Version can be set with the 'RELEASE_VERSION' environment variable, default to 'modVersion'
# For maven credentials:
# Username is set with the 'MAVEN_USER' environment variable, default to "NONE"
# Password is set with the 'MAVEN_PASSWORD' environment variable, default to "NONE"
customMavenPublishUrl =

# Enable spotless checks
# Enforces code formatting on your source code
# By default this will use the files found here: https://github.com/GregTechCEu/Buildscripts/tree/master/spotless
# to format your code. However, you can create your own version of these files and place them in your project's
# root directory to apply your own formatting options instead.
enableSpotless = false

# Enable JUnit testing platform used for testing your code.
# Uses JUnit 5. See guide and documentation here: https://junit.org/junit5/docs/current/user-guide/
enableJUnit = true

# Deployment debug setting
# Uncomment this to test deployments to CurseForge and Modrinth
# Alternatively, you can set the 'DEPLOYMENT_DEBUG' environment variable.
deploymentDebug = false


# Gradle Settings
# Effectively applies the '--stacktrace' flag by default
org.gradle.logging.stacktrace = all
## Sets default memory used for gradle commands. Can be overridden by user or command line properties.
## This is required to provide enough memory for the Minecraft decompilation process.
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false
Binary file modified gradle/wrapper/gradle-wrapper.jar
100755 → 100644
Binary file not shown.
Empty file modified gradle/wrapper/gradle-wrapper.properties
100755 → 100644
Empty file.
11 changes: 5 additions & 6 deletions gradlew
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -141,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -194,10 +197,6 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
5 changes: 5 additions & 0 deletions repositories.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Add any additional repositories for your dependencies here

repositories {

}
11 changes: 9 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ pluginManagement {
}

plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
// Automatic toolchain provisioning
id 'org.gradle.toolchains.foojay-resolver-convention' version "${foojay_version}"
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0'
}

rootProject.name = archives_base_name
blowdryerSetup {
repoSubfolder 'spotless'
github 'GregTechCEu/Buildscripts', 'tag', 'v1.0.0'
//devLocal '.' // Use this when testing config updated locally
}

rootProject.name = rootProject.projectDir.getName()
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gregicality.multiblocks;

import gregicality.GCYMInternalTags;
import gregicality.multiblocks.api.fluids.GCYMMetaFluids;
import gregicality.multiblocks.api.utils.GCYMLog;
import gregicality.multiblocks.common.CommonProxy;
Expand All @@ -18,7 +19,7 @@ public class GregicalityMultiblocks {

public static final String MODID = "gcym";
public static final String NAME = "Gregicality Multiblocks";
public static final String VERSION = "1.2.2";
public static final String VERSION = GCYMInternalTags.VERSION;

@SidedProxy(modId = MODID, clientSide = "gregicality.multiblocks.common.ClientProxy", serverSide = "gregicality.multiblocks.common.CommonProxy")
public static CommonProxy proxy;
Expand Down

0 comments on commit 3609324

Please sign in to comment.