Skip to content

Commit 8ea664d

Browse files
committed
Change packages for tunnels api, include api in main pkg, artifacts
1 parent f9b1440 commit 8ea664d

File tree

17 files changed

+44
-21
lines changed

17 files changed

+44
-21
lines changed

.github/workflows/tagged-release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ jobs:
137137
uses: actions/upload-artifact@v2
138138
with:
139139
name: libs
140-
path: build/libs/**${{ needs.vars.outputs.mod_version }}**.jar
140+
path: |
141+
buildfiles/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar
142+
buildfiles/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}-api.jar
141143
142144
view:
143145
name: View Changelog Output
@@ -179,7 +181,8 @@ jobs:
179181
prerelease: false
180182
files: |
181183
changelog/CHANGELOG.md
182-
buildfiles/**${{ needs.vars.outputs.mod_version }}**.jar
184+
buildfiles/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar
185+
buildfiles/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}-api.jar
183186
184187
- name: Full File
185188
id: filename

.github/workflows/test-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ jobs:
133133
uses: actions/upload-artifact@v2
134134
with:
135135
name: libs
136-
path: build/libs/**${{ needs.vars.outputs.mod_version }}**.jar
136+
path: |
137+
buildfiles/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar
138+
buildfiles/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}-api.jar
137139
138140
view:
139141
name: View Changelog Output

build.gradle

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ buildscript {
1010
}
1111
}
1212

13+
plugins {
14+
id "idea"
15+
}
16+
1317
apply plugin: 'net.minecraftforge.gradle'
1418
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1519
apply plugin: 'eclipse'
@@ -22,15 +26,14 @@ archivesBaseName = mod_id
2226
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
2327

2428
sourceSets {
25-
api
26-
main
29+
main{
30+
resources {
31+
srcDir 'src/generated/resources'
32+
}
33+
}
2734
test
2835
}
2936

30-
configurations {
31-
apiCompile.extendsFrom(compile)
32-
}
33-
3437
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
3538
minecraft {
3639
mappings channel: 'snapshot', version: mappings_version
@@ -95,8 +98,6 @@ minecraft {
9598
}
9699
}
97100

98-
sourceSets.main.resources { srcDir 'src/generated/resources' }
99-
100101
def getModVersion(filename) {
101102
// println(filename);
102103
def pattern = /^(?<modid>[^-]+)(?:-(?<mcversion>[0-9.]+))?(?:-(?<modver>[0-9.\-]+))\.jar$/;
@@ -156,8 +157,6 @@ dependencies {
156157
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
157158
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
158159

159-
implementation sourceSets.api.output
160-
161160
// Deobfuscate each dev mod for runtime
162161
dev_mods.each {
163162
compileOnly fg.deobf(it)
@@ -195,6 +194,23 @@ jar.finalizedBy('reobfJar')
195194
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
196195
//publish.dependsOn('reobfJar')
197196

197+
task srcJar (type: Jar) {
198+
from sourceSets.main.java
199+
classifier = 'sources'
200+
}
201+
202+
task apiJar(type: Jar) {
203+
// Sources included because of MinecraftForge/ForgeGradle#369
204+
from(sourceSets.main.allJava)
205+
from(sourceSets.main.output)
206+
include 'com/robotgryphon/compactmachines/api/**'
207+
classifier = 'api'
208+
}
209+
210+
artifacts {
211+
archives srcJar, apiJar
212+
}
213+
198214
publishing {
199215
publications {
200216
mavenJava(MavenPublication) {

src/api/java/com/robotgryphon/compactmachines/api/tunnels/EnumTunnelSide.java renamed to src/main/java/com/robotgryphon/compactmachines/api/tunnels/EnumTunnelSide.java

File renamed without changes.

src/api/java/com/robotgryphon/compactmachines/api/tunnels/ICapableTunnel.java renamed to src/main/java/com/robotgryphon/compactmachines/api/tunnels/ICapableTunnel.java

File renamed without changes.

src/api/java/com/robotgryphon/compactmachines/api/tunnels/IItemTunnel.java renamed to src/main/java/com/robotgryphon/compactmachines/api/tunnels/IItemTunnel.java

File renamed without changes.

src/api/java/com/robotgryphon/compactmachines/api/tunnels/IRedstoneTunnel.java renamed to src/main/java/com/robotgryphon/compactmachines/api/tunnels/IRedstoneTunnel.java

File renamed without changes.

src/main/java/com/robotgryphon/compactmachines/tunnels/definitions/TunnelDefinition.java renamed to src/main/java/com/robotgryphon/compactmachines/api/tunnels/TunnelDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.robotgryphon.compactmachines.tunnels.definitions;
1+
package com.robotgryphon.compactmachines.api.tunnels;
22

33
import net.minecraftforge.registries.ForgeRegistryEntry;
44

src/main/java/com/robotgryphon/compactmachines/block/tiles/CompactMachineTile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.robotgryphon.compactmachines.data.machines.CompactMachinePlayerData;
88
import com.robotgryphon.compactmachines.data.machines.CompactMachineRegistrationData;
99
import com.robotgryphon.compactmachines.reference.Reference;
10-
import com.robotgryphon.compactmachines.tunnels.definitions.TunnelDefinition;
10+
import com.robotgryphon.compactmachines.api.tunnels.TunnelDefinition;
1111
import com.robotgryphon.compactmachines.tunnels.TunnelHelper;
1212
import com.robotgryphon.compactmachines.api.tunnels.ICapableTunnel;
1313
import net.minecraft.block.BlockState;

src/main/java/com/robotgryphon/compactmachines/block/tiles/TunnelWallTile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.robotgryphon.compactmachines.network.NetworkHandler;
77
import com.robotgryphon.compactmachines.network.TunnelAddedPacket;
88
import com.robotgryphon.compactmachines.teleportation.DimensionalPosition;
9-
import com.robotgryphon.compactmachines.tunnels.definitions.TunnelDefinition;
9+
import com.robotgryphon.compactmachines.api.tunnels.TunnelDefinition;
1010
import com.robotgryphon.compactmachines.api.tunnels.ICapableTunnel;
1111
import com.robotgryphon.compactmachines.util.CompactMachineUtil;
1212
import net.minecraft.block.BlockState;

0 commit comments

Comments
 (0)