2020-07-01 13:58:47 -04:00
|
|
|
buildscript {
|
|
|
|
dependencies {
|
|
|
|
classpath 'org.kohsuke:github-api:1.114'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-05 09:54:00 -05:00
|
|
|
plugins {
|
2021-05-12 15:23:04 -04:00
|
|
|
id "java-library"
|
2020-10-11 16:28:03 -04:00
|
|
|
id "eclipse"
|
|
|
|
id "idea"
|
|
|
|
id "maven-publish"
|
2021-09-17 13:42:42 -04:00
|
|
|
id "fabric-loom" version "0.10.11" apply false
|
2021-08-31 09:00:20 -04:00
|
|
|
id "org.cadixdev.licenser" version "0.6.1"
|
2021-05-12 15:23:04 -04:00
|
|
|
id "org.ajoberstar.grgit" version "3.1.0"
|
2020-10-11 16:28:03 -04:00
|
|
|
id "com.matthewprenger.cursegradle" version "1.4.0"
|
2021-01-25 13:19:18 -05:00
|
|
|
id "com.modrinth.minotaur" version "1.1.0"
|
2018-11-05 09:54:00 -05:00
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
def ENV = System.getenv()
|
2018-11-05 09:54:00 -05:00
|
|
|
|
2019-07-14 12:42:09 -04:00
|
|
|
class Globals {
|
2021-09-09 14:28:18 -04:00
|
|
|
static def baseVersion = "0.40.1"
|
2021-09-17 13:42:42 -04:00
|
|
|
static def mcVersion = "21w37a"
|
|
|
|
static def yarnVersion = "+build.8"
|
|
|
|
static def loaderVersion = "0.11.7"
|
|
|
|
static def preRelease = true
|
2019-07-14 12:42:09 -04:00
|
|
|
}
|
|
|
|
|
2020-11-05 13:12:01 -05:00
|
|
|
version = Globals.baseVersion + "+" + (ENV.GITHUB_RUN_NUMBER ? "" : "local-") + getBranch()
|
2020-04-05 10:51:59 -04:00
|
|
|
logger.lifecycle("Building Fabric: " + version)
|
|
|
|
|
2019-07-14 12:42:09 -04:00
|
|
|
import org.apache.commons.codec.digest.DigestUtils
|
2019-05-11 02:55:17 -04:00
|
|
|
|
|
|
|
def getSubprojectVersion(project, version) {
|
2019-05-13 05:20:47 -04:00
|
|
|
if (grgit == null) {
|
|
|
|
return version + "+nogit"
|
|
|
|
}
|
2021-04-14 13:35:48 -04:00
|
|
|
|
2019-05-11 17:48:33 -04:00
|
|
|
def latestCommits = grgit.log(paths: [project.name], maxCommits: 1)
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-05-11 17:48:33 -04:00
|
|
|
if (latestCommits.isEmpty()) {
|
|
|
|
return version + "+uncommited"
|
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
|
|
|
return version + "+" + latestCommits.get(0).id.substring(0, 8) + DigestUtils.sha256Hex(Globals.mcVersion).substring(0, 2)
|
2019-05-11 02:55:17 -04:00
|
|
|
}
|
2018-11-05 09:54:00 -05:00
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
def getBranch() {
|
2020-11-05 13:12:01 -05:00
|
|
|
def ENV = System.getenv()
|
|
|
|
if (ENV.GITHUB_REF) {
|
|
|
|
def branch = ENV.GITHUB_REF
|
2019-08-27 15:40:07 -04:00
|
|
|
return branch.substring(branch.lastIndexOf("/") + 1)
|
2019-08-27 15:26:27 -04:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-08-27 15:11:55 -04:00
|
|
|
if (grgit == null) {
|
|
|
|
return "unknown"
|
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-12-27 18:32:40 -05:00
|
|
|
def branch = grgit.branch.current().name
|
|
|
|
return branch.substring(branch.lastIndexOf("/") + 1)
|
2019-08-27 15:11:55 -04:00
|
|
|
}
|
|
|
|
|
2020-11-15 14:15:35 -05:00
|
|
|
def moduleDependencies(project, List<String> depNames) {
|
|
|
|
def deps = depNames.iterator().collect { project.dependencies.project(path: ":$it", configuration: 'dev') }
|
|
|
|
project.dependencies {
|
|
|
|
deps.each {
|
2021-05-12 15:23:04 -04:00
|
|
|
api it
|
2020-11-15 14:15:35 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
project.publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
pom.withXml {
|
|
|
|
def depsNode = asNode().appendNode("dependencies")
|
|
|
|
deps.each {
|
|
|
|
def depNode = depsNode.appendNode("dependency")
|
|
|
|
depNode.appendNode("groupId", it.group)
|
|
|
|
depNode.appendNode("artifactId", it.name)
|
|
|
|
depNode.appendNode("version", it.version)
|
|
|
|
depNode.appendNode("scope", "compile")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
allprojects {
|
2021-05-12 15:23:04 -04:00
|
|
|
apply plugin: "java-library"
|
2020-10-11 16:28:03 -04:00
|
|
|
apply plugin: "checkstyle"
|
|
|
|
apply plugin: "maven-publish"
|
|
|
|
apply plugin: "fabric-loom"
|
2021-05-12 15:23:04 -04:00
|
|
|
apply plugin: "org.cadixdev.licenser"
|
2018-12-14 13:48:37 -05:00
|
|
|
|
2020-11-10 14:58:58 -05:00
|
|
|
tasks.withType(JavaCompile).configureEach {
|
2021-05-12 15:23:04 -04:00
|
|
|
it.options.release = 16
|
2020-11-10 14:58:58 -05:00
|
|
|
}
|
2018-11-05 09:54:00 -05:00
|
|
|
|
2019-04-24 13:15:08 -04:00
|
|
|
group = "net.fabricmc.fabric-api"
|
|
|
|
|
2020-05-03 12:56:50 -04:00
|
|
|
sourceSets {
|
|
|
|
testmod {
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
runtimeClasspath += main.runtimeClasspath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-12 15:23:04 -04:00
|
|
|
loom {
|
|
|
|
runs {
|
|
|
|
testmodClient {
|
|
|
|
client()
|
|
|
|
ideConfigGenerated project.rootProject == project
|
|
|
|
name = "Testmod Client"
|
|
|
|
source sourceSets.testmod
|
|
|
|
}
|
|
|
|
testmodServer {
|
|
|
|
server()
|
|
|
|
ideConfigGenerated project.rootProject == project
|
|
|
|
name = "Testmod Server"
|
|
|
|
source sourceSets.testmod
|
|
|
|
}
|
|
|
|
}
|
2020-11-15 14:06:27 -05:00
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
dependencies {
|
2019-07-14 12:42:09 -04:00
|
|
|
minecraft "com.mojang:minecraft:$Globals.mcVersion"
|
2019-12-10 02:43:00 -05:00
|
|
|
mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}:v2"
|
2021-05-12 15:23:04 -04:00
|
|
|
modApi "net.fabricmc:fabric-loader:${Globals.loaderVersion}"
|
2019-04-23 18:46:23 -04:00
|
|
|
}
|
2018-12-09 11:47:35 -05:00
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
configurations {
|
|
|
|
dev
|
|
|
|
}
|
2018-11-05 09:54:00 -05:00
|
|
|
|
2020-09-10 12:36:46 -04:00
|
|
|
loom {
|
2021-08-31 09:00:20 -04:00
|
|
|
shareRemapCaches = true
|
2020-09-10 12:36:46 -04:00
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
}
|
|
|
|
|
2019-07-24 17:07:45 -04:00
|
|
|
jar {
|
2021-05-12 15:23:04 -04:00
|
|
|
archiveClassifier = "dev"
|
2019-07-24 17:07:45 -04:00
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
afterEvaluate {
|
2019-07-24 17:07:45 -04:00
|
|
|
remapJar {
|
2021-08-31 09:00:20 -04:00
|
|
|
input = file("${project.buildDir}/libs/$archivesBaseName-${project.version}-dev.jar")
|
|
|
|
archiveFileName = "${archivesBaseName}-${project.version}.jar"
|
2019-07-24 17:07:45 -04:00
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
artifacts {
|
2021-08-31 09:00:20 -04:00
|
|
|
dev file: file("${project.buildDir}/libs/$archivesBaseName-${project.version}-dev.jar"), type: "jar", builtBy: jar
|
2019-04-23 18:46:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
inputs.property "version", project.version
|
|
|
|
|
2021-05-12 15:23:04 -04:00
|
|
|
filesMatching("fabric.mod.json") {
|
2019-04-23 18:46:23 -04:00
|
|
|
expand "version": project.version
|
|
|
|
}
|
|
|
|
}
|
2019-04-26 14:18:20 -04:00
|
|
|
|
|
|
|
license {
|
2020-10-11 16:28:03 -04:00
|
|
|
header rootProject.file("HEADER")
|
|
|
|
include "**/*.java"
|
2019-04-26 14:18:20 -04:00
|
|
|
}
|
2019-04-23 18:46:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
2020-10-11 16:28:03 -04:00
|
|
|
archiveClassifier = "sources"
|
2019-04-23 18:46:23 -04:00
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
2019-10-26 22:39:47 -04:00
|
|
|
|
|
|
|
checkstyle {
|
|
|
|
configFile = rootProject.file("checkstyle.xml")
|
Fabric Transfer API: "fluid only" edition (#1356)
* Original fluid API design
* Rework the transaction system
* First javadoc pass
* Add a testmod, a base implementation for fluid storages and fix some little bugs
* Fix checkstyle
* Make Movement#move extract from the view and not the whole Storage
* Document and update FluidPreconditions
* Use for-each in CombinedStorage and document a little
* Remove useless overrides in Insertion/ExtractionOnlyStorage
* Move SnapshotParticipant#snapshots to the top of the class, and make updateSnapshots public
* Fix garbage collection of unused CauldronWrappers
* Use ArrayList directly
* Remove locking, reorganize transaction implementation, and add outer close callback
* Add more javadoc
* Rework Storage#forEach into Storage#iterator
* Add a few missing `transaction.addCloseCallback(iterator)`
* Add anyView(), exactView(), capacity() and isEmpty()
* Add Storage#iterable to make iteration friendlier to for loops
* Storages may now have multiple open iterators
Co-authored-by: Devan-Kerman <dev.sel20@gmail.com>
* Make CombinedStorage#supportsInsertion/Extraction iterate through the parts
* Block updates should be used when the supportsInsertion/Extraction status changes
* Fluid -> FluidKey
* Remove all references to ItemKey inside FluidKey, and other minor tweaks
* Cache FluidKeys with a null tag inside Fluid directly
* Fluid unit convention
* Add FluidKeyRendering and RenderHandler
* Bump version for more testing (also published to my maven)
* Add SingleViewIterator, massively reduce code duplication!
* Make API experimental, and add README
* Bump version
* Apparently Fluids.EMPTY is flowing
* Add package info
* Minor adjustements
* 1.17 port, cauldron support, add ResourceKey
* Checkstyle, gas rendering, use record for ResourceAmount
* Add a few helpers, rename some stuff
* Remove anyView, allow nullable in StorageUtil#find*, fix missing try block
* Slight findStoredResource cleanup
* Slightly improve implementation
* Bump version
* Fix wrong transaction
* I wrote in a comment that this could happen...
* Fix SingleFluidStorage bugs, add tests in the testmod, add testmod assets
* Add extract stick
* Rename a few things
* `ResourceKey<T>` -> `TransferKey<O>`
* `ResourceKey#getResource()` -> `TransferKey#getObject()` as resource is already widely used through the API for the keys themselves.
* `tag` -> `nbt`
* Add `get` prefixes to `StorageView` functions
* Bump version
* FluidKey -> FluidVariant
* Bump version
* Expand getVersion() documentation, make it thread-safe and use long.
Co-authored-by: Player <player@player.to>
* empty resource -> blank resource, and update SingleFluidStorage
Co-authored-by: Player <player@player.to>
* Make CauldronFluidContent a final class instead of a record.
Co-authored-by: Player <player@player.to>
* Get rid of CauldronFluidContent#minLevel (was always 1)
* Fix nested commits. (Thanks @warjort!)
* Separate Transaction and TransactionContext
Co-authored-by: Devan-Kerman <dev.sel20@gmail.com>
Co-authored-by: Player <player@player.to>
* Change WorldLocation into a private record
* Bump version
* Guard against exceptions thrown in close callbacks
* Make sure blank fluid variants don't have a tag
* Add documentation, make CauldronStorage clearer
Co-authored-by: frqnny <45723631+frqnny@users.noreply.github.com>
* Allow null storages in StorageUtil#move, and clarify sidedness of FluidStorage
* Add explicit hashCode and equals for transfer variants
* Remove ugly equals and hashCode overrides, and add constant time hashcode spec
Co-authored-by: Devan-Kerman <dev.sel20@gmail.com>
Co-authored-by: liach <liach@users.noreply.github.com>
Co-authored-by: Player <player@player.to>
Co-authored-by: frqnny <45723631+frqnny@users.noreply.github.com>
2021-07-12 13:28:33 -04:00
|
|
|
toolVersion = "8.43"
|
2019-10-26 22:39:47 -04:00
|
|
|
}
|
2021-05-12 15:23:04 -04:00
|
|
|
|
|
|
|
tasks.withType(AbstractArchiveTask) {
|
|
|
|
preserveFileTimestamps = false
|
|
|
|
reproducibleFileOrder = true
|
|
|
|
}
|
2019-06-27 12:22:48 -04:00
|
|
|
}
|
2019-10-26 22:39:47 -04:00
|
|
|
|
2021-01-19 13:48:09 -05:00
|
|
|
// Apply auxiliary buildscripts to submodules
|
|
|
|
// This must be done after all plugins are applied to subprojects
|
|
|
|
apply from: "gradle/module-validation.gradle"
|
|
|
|
|
2019-10-26 22:39:47 -04:00
|
|
|
javadoc {
|
2020-04-05 10:07:27 -04:00
|
|
|
options {
|
2021-07-12 14:25:45 -04:00
|
|
|
source = "16"
|
2020-10-11 16:28:03 -04:00
|
|
|
encoding = "UTF-8"
|
|
|
|
charSet = "UTF-8"
|
2020-04-05 10:07:27 -04:00
|
|
|
memberLevel = JavadocMemberLevel.PACKAGE
|
|
|
|
links(
|
2020-10-11 16:28:03 -04:00
|
|
|
"https://guava.dev/releases/21.0/api/docs/",
|
|
|
|
"https://asm.ow2.io/javadoc/",
|
|
|
|
"https://docs.oracle.com/javase/8/docs/api/",
|
|
|
|
"http://jenkins.liteloader.com/job/Mixin/javadoc/",
|
|
|
|
"https://logging.apache.org/log4j/2.x/log4j-api/apidocs/"
|
2020-04-05 10:07:27 -04:00
|
|
|
// Need to add minecraft jd publication etc once there is one available
|
|
|
|
)
|
|
|
|
// Disable the crazy super-strict doclint tool in Java 8
|
2020-10-11 16:28:03 -04:00
|
|
|
addStringOption("Xdoclint:none", "-quiet")
|
2020-04-05 10:07:27 -04:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
allprojects.each {
|
|
|
|
source(it.sourceSets.main.allJava.srcDirs)
|
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-06-27 12:22:48 -04:00
|
|
|
classpath = sourceSets.main.compileClasspath
|
2020-04-05 10:07:27 -04:00
|
|
|
include("**/api/**")
|
2020-02-10 12:05:41 -05:00
|
|
|
failOnError false
|
2018-12-22 10:21:31 -05:00
|
|
|
}
|
|
|
|
|
2020-02-10 12:05:41 -05:00
|
|
|
task javadocJar(type: Jar) {
|
2020-04-05 10:07:27 -04:00
|
|
|
dependsOn javadoc
|
|
|
|
from javadoc.destinationDir
|
2020-02-10 12:05:41 -05:00
|
|
|
//Set as `fatjavadoc` to prevent an ide form trying to use this javadoc, over using the modules javadoc
|
2020-10-11 16:28:03 -04:00
|
|
|
archiveClassifier = "fatjavadoc"
|
2020-02-10 12:05:41 -05:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2020-02-10 12:05:41 -05:00
|
|
|
build.dependsOn javadocJar
|
|
|
|
|
2020-11-15 14:06:27 -05:00
|
|
|
// Runs a dedicated headless server with all test mods that closes once complete.
|
2021-05-12 15:23:04 -04:00
|
|
|
loom {
|
|
|
|
runs {
|
|
|
|
autoTestServer {
|
|
|
|
inherit testmodServer
|
|
|
|
vmArg "-Dfabric.autoTest"
|
|
|
|
}
|
2020-11-15 14:06:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
subprojects {
|
2020-05-03 12:56:50 -04:00
|
|
|
dependencies {
|
2021-05-12 15:23:04 -04:00
|
|
|
testmodImplementation sourceSets.main.output
|
2020-05-03 12:56:50 -04:00
|
|
|
}
|
|
|
|
|
2019-04-23 19:14:43 -04:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
2020-04-05 10:51:59 -04:00
|
|
|
afterEvaluate {
|
2021-08-31 09:00:20 -04:00
|
|
|
artifact(remapJar) {
|
|
|
|
builtBy remapJar
|
2020-04-05 10:51:59 -04:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2020-04-05 10:51:59 -04:00
|
|
|
artifact(sourcesJar) {
|
|
|
|
builtBy remapSourcesJar
|
|
|
|
}
|
2019-04-23 19:14:43 -04:00
|
|
|
}
|
|
|
|
}
|
2019-07-24 17:07:45 -04:00
|
|
|
}
|
2019-04-23 19:14:43 -04:00
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
setupRepositories(repositories)
|
2019-04-23 19:14:43 -04:00
|
|
|
}
|
|
|
|
|
2021-09-17 13:42:42 -04:00
|
|
|
// Required as moduleDependencies modifies the pom
|
|
|
|
loom.disableDeprecatedPomGeneration(publishing.publications.mavenJava)
|
|
|
|
|
2019-06-27 12:22:48 -04:00
|
|
|
javadoc.enabled = false
|
2019-04-23 18:46:23 -04:00
|
|
|
}
|
2019-04-03 15:34:09 -04:00
|
|
|
|
2019-05-10 19:02:20 -04:00
|
|
|
task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {
|
2021-08-31 09:00:20 -04:00
|
|
|
input = jar.archiveFile
|
|
|
|
archiveFileName = "${archivesBaseName}-${project.version}-maven.jar"
|
|
|
|
addNestedDependencies = false
|
2019-04-23 18:46:23 -04:00
|
|
|
}
|
2021-08-31 09:00:20 -04:00
|
|
|
build.dependsOn remapMavenJar
|
2019-04-03 15:34:09 -04:00
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
2021-08-31 09:00:20 -04:00
|
|
|
artifact(remapMavenJar) {
|
2019-04-23 19:14:43 -04:00
|
|
|
builtBy remapMavenJar
|
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-04-23 19:14:43 -04:00
|
|
|
artifact(sourcesJar) {
|
|
|
|
builtBy remapSourcesJar
|
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
artifact javadocJar
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
pom.withXml {
|
|
|
|
def depsNode = asNode().appendNode("dependencies")
|
|
|
|
subprojects.each {
|
|
|
|
def depNode = depsNode.appendNode("dependency")
|
|
|
|
depNode.appendNode("groupId", it.group)
|
|
|
|
depNode.appendNode("artifactId", it.name)
|
2019-05-17 10:20:37 -04:00
|
|
|
depNode.appendNode("version", it.version)
|
2019-04-23 18:46:23 -04:00
|
|
|
depNode.appendNode("scope", "compile")
|
|
|
|
}
|
|
|
|
}
|
2019-11-28 03:03:04 -05:00
|
|
|
}
|
2019-04-03 15:34:09 -04:00
|
|
|
}
|
2019-04-23 19:14:43 -04:00
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
setupRepositories(repositories)
|
|
|
|
}
|
|
|
|
|
2021-09-17 13:42:42 -04:00
|
|
|
loom.disableDeprecatedPomGeneration(publishing.publications.mavenJava)
|
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
void setupRepositories(RepositoryHandler repositories) {
|
|
|
|
//repositories.mavenLocal() // uncomment for testing
|
2020-11-05 13:12:01 -05:00
|
|
|
def ENV = System.getenv()
|
|
|
|
if (ENV.MAVEN_URL) {
|
2020-04-05 10:07:27 -04:00
|
|
|
repositories.maven {
|
2020-11-05 13:12:01 -05:00
|
|
|
url ENV.MAVEN_URL
|
Fabric Transfer API: item transfer and fluid-containing items. (#1553)
* Add item and "fluid item" APIs
* Rework ContainerItemContext javadoc
* Rework the Inventory wrapper API
* Cleanup inventory wrapper implementation, add < 64 max stack count test, separate tests better
* Fix Inventory wrapper not limiting the stack count correctly (thanks @lilybeevee!)
* Rewrite inventory wrapper, add SingleStackStorage base implementation
* Composters
* SingleStackStorage adjustements
* Bump version
* Move icon to correct location. Closes #1565
* Bump version
* Remove composter implementation (it's broken), slight renames
* Fix SidedInventory extract
* Bump version
* Don't use MAVEN_USERNAME if it's not specified
* Add comparator output, add missing markDirty calls, fix tests
* Bump version
* Add SingleVariantStorage, deprecate SingleFluidStorage, definalize a few things, make sure markDirty() is only called once per successful outer transaction in inventory wrappers
* Add composter support
* Move EmptyFluidView to BlankVariantView, update README and package-info
* Bump version
* Key -> variant
* Add Transaction#openNested(@Nullable TransactionContext)
* Add SingleSlotContainerItemContext
* Bump prerelease version
* Remove useless comment
* Remove ContainerItemContext#getWorld
* Bump prerelease version
* Add StorageUtil#findExtractableContent and ContainerItemContext#withInitial
* Bump prerelease version
2021-08-17 14:08:09 -04:00
|
|
|
if (ENV.MAVEN_USERNAME) {
|
|
|
|
credentials {
|
|
|
|
username ENV.MAVEN_USERNAME
|
|
|
|
password ENV.MAVEN_PASSWORD
|
|
|
|
}
|
2019-04-23 19:14:43 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-04-03 15:34:09 -04:00
|
|
|
}
|
|
|
|
|
2019-04-26 14:18:20 -04:00
|
|
|
task licenseFormatAll
|
|
|
|
subprojects { p -> licenseFormatAll.dependsOn("${p.path}:licenseFormat") }
|
2019-05-11 17:48:33 -04:00
|
|
|
subprojects.each { remapJar.dependsOn("${it.path}:remapJar") }
|
2019-04-26 14:18:20 -04:00
|
|
|
|
2020-05-03 12:56:50 -04:00
|
|
|
sourceSets {
|
|
|
|
testmod
|
|
|
|
}
|
|
|
|
|
2021-08-31 08:59:35 -04:00
|
|
|
// These modules are not included in the fat jar, maven will resolve them via the pom.
|
|
|
|
def devOnlyModules = [
|
|
|
|
"fabric-gametest-api-v1"
|
|
|
|
]
|
|
|
|
|
2019-04-23 18:46:23 -04:00
|
|
|
dependencies {
|
|
|
|
afterEvaluate {
|
|
|
|
subprojects.each {
|
2021-05-12 15:23:04 -04:00
|
|
|
api project(path: ":${it.name}", configuration: "dev")
|
2021-08-31 08:59:35 -04:00
|
|
|
|
|
|
|
if (!(it.name in devOnlyModules)) {
|
|
|
|
include project("${it.name}:")
|
|
|
|
}
|
2020-05-03 12:56:50 -04:00
|
|
|
|
2021-05-12 15:23:04 -04:00
|
|
|
testmodImplementation project("${it.name}:").sourceSets.testmod.output
|
2019-04-23 18:46:23 -04:00
|
|
|
}
|
|
|
|
}
|
2018-11-05 09:54:00 -05:00
|
|
|
}
|
|
|
|
|
2019-05-11 18:00:57 -04:00
|
|
|
curseforge {
|
2020-11-05 13:12:01 -05:00
|
|
|
if (ENV.CURSEFORGE_API_KEY) {
|
|
|
|
apiKey = ENV.CURSEFORGE_API_KEY
|
2019-05-11 18:00:57 -04:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-05-11 18:00:57 -04:00
|
|
|
project {
|
2020-10-11 16:28:03 -04:00
|
|
|
id = "306612"
|
2021-07-23 12:05:52 -04:00
|
|
|
changelog = ENV.CHANGELOG ?: "No changelog provided"
|
2021-01-25 13:19:18 -05:00
|
|
|
releaseType = Globals.preRelease ? "beta" : "release"
|
2021-07-12 14:25:45 -04:00
|
|
|
addGameVersion "1.17.1"
|
2020-10-11 16:28:03 -04:00
|
|
|
addGameVersion "Fabric"
|
|
|
|
|
2019-05-11 18:00:57 -04:00
|
|
|
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
|
2020-11-05 13:42:17 -05:00
|
|
|
displayName = "[$Globals.mcVersion] Fabric API $Globals.baseVersion"
|
2019-05-11 18:00:57 -04:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2019-05-11 18:00:57 -04:00
|
|
|
afterEvaluate {
|
|
|
|
uploadTask.dependsOn("remapJar")
|
|
|
|
}
|
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2020-04-05 10:07:27 -04:00
|
|
|
options {
|
2019-05-11 18:00:57 -04:00
|
|
|
forgeGradleIntegration = false
|
|
|
|
}
|
|
|
|
}
|
2018-12-14 13:48:37 -05:00
|
|
|
|
2020-07-01 13:58:47 -04:00
|
|
|
import org.kohsuke.github.GHReleaseBuilder
|
|
|
|
import org.kohsuke.github.GitHub
|
|
|
|
|
|
|
|
task github(dependsOn: remapMavenJar) {
|
|
|
|
onlyIf {
|
2020-11-05 13:12:01 -05:00
|
|
|
ENV.GITHUB_TOKEN
|
2020-07-01 13:58:47 -04:00
|
|
|
}
|
2020-10-11 16:28:03 -04:00
|
|
|
|
2020-07-01 13:58:47 -04:00
|
|
|
doLast {
|
2020-11-05 13:12:01 -05:00
|
|
|
def github = GitHub.connectUsingOAuth(ENV.GITHUB_TOKEN as String)
|
|
|
|
def repository = github.getRepository(ENV.GITHUB_REPOSITORY)
|
2020-07-01 13:58:47 -04:00
|
|
|
|
|
|
|
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
2020-11-05 13:53:10 -05:00
|
|
|
releaseBuilder.name("[$Globals.mcVersion] Fabric API $Globals.baseVersion")
|
2021-07-23 12:05:52 -04:00
|
|
|
releaseBuilder.body(ENV.CHANGELOG ?: "No changelog provided")
|
2020-07-01 13:58:47 -04:00
|
|
|
releaseBuilder.commitish(getBranch())
|
2021-01-25 13:19:18 -05:00
|
|
|
releaseBuilder.prerelease(Globals.preRelease)
|
2020-07-01 13:58:47 -04:00
|
|
|
|
|
|
|
def ghRelease = releaseBuilder.create()
|
|
|
|
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
|
|
|
|
}
|
|
|
|
}
|
2020-11-05 13:12:01 -05:00
|
|
|
|
2021-01-25 13:19:18 -05:00
|
|
|
task modrinth(type: com.modrinth.minotaur.TaskModrinthUpload, dependsOn: remapMavenJar) {
|
|
|
|
onlyIf {
|
|
|
|
ENV.MODRINTH_TOKEN
|
|
|
|
}
|
|
|
|
|
|
|
|
token = ENV.MODRINTH_TOKEN
|
|
|
|
projectId = "P7dR8mSH"
|
|
|
|
versionNumber = version
|
|
|
|
versionName = "[$Globals.mcVersion] Fabric API $Globals.baseVersion"
|
|
|
|
releaseType = Globals.preRelease ? "beta" : "release"
|
2021-07-23 12:05:52 -04:00
|
|
|
changelog = ENV.CHANGELOG ?: "No changelog provided"
|
2021-01-25 13:19:18 -05:00
|
|
|
|
|
|
|
uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")
|
|
|
|
|
|
|
|
addGameVersion(Globals.mcVersion)
|
|
|
|
addLoader('fabric')
|
|
|
|
}
|
|
|
|
|
2020-11-05 13:12:01 -05:00
|
|
|
// A task to ensure that the version being released has not already been released.
|
|
|
|
task checkVersion {
|
|
|
|
doFirst {
|
|
|
|
def xml = new URL("https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml").text
|
|
|
|
def metadata = new XmlSlurper().parseText(xml)
|
|
|
|
def versions = metadata.versioning.versions.version*.text();
|
|
|
|
if (versions.contains(version)) {
|
|
|
|
throw new RuntimeException("${version} has already been released!")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
github.mustRunAfter checkVersion
|
2021-01-25 13:19:18 -05:00
|
|
|
modrinth.mustRunAfter checkVersion
|
2020-11-05 13:12:01 -05:00
|
|
|
publish.mustRunAfter checkVersion
|
|
|
|
project.tasks.curseforge.mustRunAfter checkVersion
|