Skip to content

Commit

Permalink
Generate multiple module jars
Browse files Browse the repository at this point in the history
  • Loading branch information
unascribed committed Apr 26, 2017
1 parent a1eb593 commit 60e3517
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 12 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
*A solid foundation for Elytra mods.*

Concrete is a varied set of useful *stuff* that is designed to be shaded into a
mod's jar, meaning it's not a runtime dependency.
mod's jar, meaning it's not a runtime dependency and is rather included in the
dependent mod itself.

## Features

* Easy networking primitives, based on a Message class
* Easy reflection primitives that take advantage of MethodHandles when possible
* NBT {de,}serialization utilities (common module)
* Easy networking primitives, based on a Message class (network module)
* Easy reflection primitives that take advantage of MethodHandles when possible (reflect module)
* Functional-style block classes (block module)

More coming soon!

Expand Down Expand Up @@ -52,10 +55,19 @@ artifacts {
}
dependencies {
compile 'com.elytradev:concrete:0.1.0'
shadow 'com.elytradev:concrete:0.1.0'
compile 'com.elytradev:concrete:0.2.1:common'
shadow 'com.elytradev:concrete:0.2.1:common'
compile 'com.elytradev:concrete:0.2.1:<module name>'
shadow 'com.elytradev:concrete:0.2.1:<module name>'
}
```

Of course, any other method of shading will work too. The Gradle Shadow plugin
is what we recommend, though.
is what we recommend, though.

Alternatively, you can use the [Elytra Project Skeleton](https://github.com/elytra/skel),
which is designed for Elytra mods, but should work for any mod project.

Concrete only supports the latest version of Minecraft, but its utilities are generic
enough that they are known to sometimes work on older versions if used with caution.
45 changes: 40 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ apply plugin: 'maven'

group = "com.elytradev"
archivesBaseName = "Concrete"
version = "0.2.0"
version = "0.2.1"

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -66,13 +66,48 @@ processResources {
}
}

task deobfJar(type: Jar, dependsOn: 'jar') {
classifier 'deobf'
from 'build/classes/main'
jar {
classifier = 'all'
}

task commonJar(type: Jar) {
classifier = 'common'
from(sourceSets.main.output) {
include 'com/elytradev/concrete/common/**'
}
}

task blockJar(type: Jar) {
classifier = 'block'
from(sourceSets.main.output) {
include 'com/elytradev/concrete/block/**'
}
}

task networkJar(type: Jar) {
classifier = 'network'
from(sourceSets.main.output) {
include 'com/elytradev/concrete/network/**'
}
}

task reflectJar(type: Jar) {
classifier = 'reflect'
from(sourceSets.main.output) {
include 'com/elytradev/concrete/reflect/**'
}
}

reobf {
commonJar { mappingType = 'SEARGE' }
blockJar { mappingType = 'SEARGE' }
networkJar { mappingType = 'SEARGE' }
reflectJar { mappingType = 'SEARGE' }
}


artifacts {
archives deobfJar
archives commonJar, blockJar, networkJar, reflectJar
}

def parseConfig(File config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.elytradev.concrete;
package com.elytradev.concrete.common;

import java.util.ArrayList;
import java.util.Collection;
Expand Down

0 comments on commit 60e3517

Please sign in to comment.