Ok so, this bit here (redacted for simplicity):
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
exclude 'com/draco18s/ores/**', 'com/draco18s/industry/**'
}
This removes my "actual mod" from being included in a compiled jar file. In this case, it excludes the folder com/draco18s/ores and com/draco18s/industry, as we only want the library in this jar.
Then this bit here:
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
include 'com/draco18s/ores/**', 'assets/harderores/**', 'cog_config/**'
exclude '**.xcf'
}
Makes sure to only include com/draco18s/ores, and its associated assets. The exclude line makes sure not to include large, layered, GIMP image files that aren't actually used by the mod (it's a template for the icons actually used). Your gradle file will already have one task that builds everything. You can rename it and modify the include/exclude as appropriate, then duplicate and modify again, using a new task name.
At the bottom, these bits:
oresJar.dependsOn('reobfJar')
set up to make sure that gradle does all of the appropriate compilation tasks in the proper order.
Lastly, this is a task that does a full compile (builds all the jars, redacted slightly for simplicity):
task releaseJars(type: Copy) {
from coreJarNoCog
from oresJar
rename '-(.*)jar', '.jar'
rename '-(.*)zip', '.zip'
into '.'
}
This task will already exist in your gradle file, you just need to add the from lines so that a full build builds all of your other jar tasks.