Skip to content

Commit

Permalink
Update build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Jan 18, 2023
1 parent 340f634 commit 852aebd
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .jenkins/Jenkinsfile
@@ -1,7 +1,7 @@
pipeline {
agent any
tools {
jdk "jdk-17.0.1"
jdk "jdk8u292-b10"
}

environment {
Expand Down
56 changes: 24 additions & 32 deletions build.gradle
Expand Up @@ -21,6 +21,7 @@ plugins {
id 'java'
id 'eclipse'
id 'idea'
id "maven-publish"
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.71.4'
}
Expand All @@ -40,15 +41,17 @@ version = "${semver}.${build_number}"
group = 'mezz.jei' // http://maven.apache.org/guides/mini/guide-naming-conventions.html

sourceSets {
api
api {
//The API has no resources
resources.srcDirs = []
}
main {
compileClasspath += sourceSets.api.output
runtimeClasspath += sourceSets.api.output
resources {
srcDir 'src/generated/resources'
}
}
test {
//The test module has no resources
resources.srcDirs = []
compileClasspath += sourceSets.api.output
runtimeClasspath += sourceSets.api.output
}
Expand All @@ -63,16 +66,16 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(8)

dependencies {
minecraft([
group : "${project.forgegroup}",
group : "${project.forge_group}",
name : 'forge',
version: "${project.mcversion}-${project.forgeversion}"
version: "${project.minecraft_version}-${project.forge_version}"
])
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.2"
}

minecraft {
mappings channel: 'official', version: project.mcversion
mappings channel: 'official', version: project.minecraft_version

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

Expand All @@ -91,14 +94,6 @@ minecraft {
jei.sources((SourceSet[]) [sourceSets.main, sourceSets.api])
}
}
data {
property 'forge.logging.console.level', 'debug'
workingDirectory file('run')
args '--mod', 'jei', '--all', '--output', file('src/generated/resources/')
mods {
jei.sources((SourceSet[]) [sourceSets.main, sourceSets.api])
}
}
}
}

Expand All @@ -107,7 +102,7 @@ def replaceResources = tasks.register("replaceResources", Copy) {
//Copy it into the build dir
it.from(sourceSets.main.resources) {
include "META-INF/mods.toml"
expand 'version': version, 'mc_version': minecraft_version_range, 'forge_version': forge_version_range
expand 'version': version, 'mc_version': minecraft_version_range, 'forge_version': forge_version_range, "loader_version": loader_version_range
}
it.into "$buildDir/resources/main/"
}
Expand All @@ -128,7 +123,8 @@ javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}

task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
task makeChangelog(type: GitChangelogTask) {
fromRepo = file("$projectDir")
file = file('changelog.html')
untaggedName = "Current release ${project.version}"
fromCommit = '2fe051cf727adce1be210a46f778aa8fe031331e'
Expand All @@ -143,6 +139,7 @@ curseforge {
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'beta'
addGameVersion "${minecraft_version}"
}
}

Expand Down Expand Up @@ -245,6 +242,7 @@ jar {
'Implementation-Version' : "${project.version}",
'Implementation-Vendor' : 'mezz',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Automatic-Module-Name": "mezz.jei",
])

finalizedBy 'reobfJar'
Expand Down Expand Up @@ -299,21 +297,15 @@ task reobf {
dependsOn reobfApiJar
}

task uploadJars(dependsOn: build) {
description = 'Uploads JARs'
if (project.hasProperty('local_maven')) {
apply plugin: 'maven-publish'
publishing {
publications { PublicationContainer publicationContainer ->
publicationContainer.register("maven", MavenPublication) { MavenPublication publication ->
publication.artifacts = [apiJar, jar, javadocJar, deobfJar, sourcesJar]
}
}
repositories {
maven {
url("file://${local_maven}")
}
}
publishing {
publications { PublicationContainer publicationContainer ->
publicationContainer.register("maven", MavenPublication) { MavenPublication publication ->
publication.artifacts = [apiJar, jar, javadocJar, deobfJar, sourcesJar]
}
}
repositories {
if (project.hasProperty('DEPLOY_DIR')) {
maven { url DEPLOY_DIR }
}
}
}
Expand Down
16 changes: 11 additions & 5 deletions gradle.properties
@@ -1,14 +1,20 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mcversion=1.16.5
forgeversion=36.2.30
forge_version_range=[34.0.3,)
# Minecraft
minecraft_version=1.16.5
minecraft_version_range=[1.16.2, 1.17)
forgegroup=net.minecraftforge

# Forge
forge_version=36.2.30
loader_version_range=[34,)
forge_version_range=[34.0.3,)
forge_group=net.minecraftforge

# Publishing
curse_project_id=238222
ftb_library_version=1605.3.0-build.64

# Version
version_major=7
version_minor=7
version_patch=1
2 changes: 1 addition & 1 deletion settings.gradle
@@ -1 +1 @@
rootProject.name = "jei-${mcversion}"
rootProject.name = "jei-${minecraft_version}"
30 changes: 15 additions & 15 deletions src/main/resources/META-INF/mods.toml
Expand Up @@ -7,7 +7,7 @@
modLoader="javafml" #mandatory

# A version range to match for said mod loader - for regular FML @Mod it will be the minecraft version (without the 1.)
loaderVersion="[34,)" #mandatory
loaderVersion="${loader_version}" #mandatory

# A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/mezz/JustEnoughItems/issues?q=is%3Aissue" #optional
Expand Down Expand Up @@ -52,19 +52,19 @@ JEI is an item and recipe viewing mod for Minecraft, built from the ground up fo

# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.jei]]
modId="forge" #mandatory
mandatory=true #mandatory
versionRange="${forge_version}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
modId="forge" #mandatory
mandatory=true #mandatory
versionRange="${forge_version}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"

[[dependencies.jei]]
modId="minecraft" #mandatory
mandatory=true #mandatory
versionRange="${mc_version}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
modId="minecraft" #mandatory
mandatory=true #mandatory
versionRange="${mc_version}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"

0 comments on commit 852aebd

Please sign in to comment.