-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ArisuOngaku/test-mod-separation
Turn project into multiple project structure (separate test and base)
- Loading branch information
Showing
20 changed files
with
142 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,62 @@ | ||
plugins { | ||
id 'fabric-loom' version '0.2.6-SNAPSHOT' | ||
id 'maven-publish' | ||
id 'fabric-loom' version '0.2.6-SNAPSHOT' apply false | ||
} | ||
|
||
allprojects { | ||
apply plugin: 'fabric-loom' | ||
|
||
// Java | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
// Project | ||
group = project.mod_group | ||
archivesBaseName = project.mod_name | ||
version = project.mod_version | ||
|
||
// Dependencies | ||
dependencies { | ||
minecraft "com.mojang:minecraft:${mc_version}" | ||
mappings "net.fabricmc:yarn:${yarn_mappings}" | ||
modCompile "net.fabricmc:fabric-loader:${loader_version}" | ||
modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}" | ||
} | ||
} | ||
|
||
subprojects { | ||
afterEvaluate { | ||
jar { | ||
from "LICENSE.md" | ||
manifest { | ||
attributes([ | ||
"Implementation-Title": project.name, | ||
"Implementation-Version": project.version, | ||
"Maven-Artifact": "${project.group}:${project.archivesBaseName}:${project.version}".toLowerCase(Locale.ROOT), | ||
"Built-On-Minecraft": "${mc_version}", | ||
"Built-On-Java": "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})" | ||
]) | ||
} | ||
} | ||
|
||
// Resource processing | ||
processResources { | ||
inputs.property 'archivesBaseName', project.archivesBaseName | ||
inputs.property 'version', project.version | ||
|
||
from(sourceSets.main.resources.srcDirs) { | ||
include 'fabric.mod.json' | ||
expand 'modid': project.archivesBaseName, | ||
'version': project.version | ||
} | ||
|
||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'fabric.mod.json' | ||
} | ||
} | ||
} | ||
} | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
group = project.mod_group | ||
archivesBaseName = project.mod_name | ||
version = project.mod_version | ||
minecraft { | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
maven { url = "https://oss.sonatype.org/content/repositories/releases/" } | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${mc_version}" | ||
mappings "net.fabricmc:yarn:${yarn_mappings}" | ||
modCompile "net.fabricmc:fabric-loader:${loader_version}" | ||
modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}" | ||
modCompile "de.javagl:obj:${javagl_version}" | ||
include "de.javagl:obj:${javagl_version}" | ||
} | ||
|
||
jar { | ||
from "LICENSE.md" | ||
manifest.mainAttributes( | ||
"Implementation-Title": project.name, | ||
"Implementation-Version": project.version, | ||
"Maven-Artifact": "${project.group}:${project.archivesBaseName}:${project.version}".toLowerCase(Locale.ROOT), | ||
"Built-On-Minecraft": "${mc_version}", | ||
"Built-On-Java": "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})" | ||
) | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
afterEvaluate { | ||
artifact(remapJar) { | ||
builtBy remapJar | ||
} | ||
} | ||
artifact sourcesJar | ||
pom { | ||
name = "FOML" | ||
url = "https://github.com/NerdHubMC/FOML" | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "https://github.com/NerdHubMC/FOML/blob/master/LICENSE.md" | ||
} | ||
} | ||
scm { | ||
url = "https://github.com/NerdHubMC/FOML" | ||
connection = "scm:git:git://github.com/NerdHubMC/FOML.git" | ||
developerConnection = "scm:git:git@github.com:NerdHubMC/FOML.git" | ||
} | ||
issueManagement { | ||
system = "github" | ||
url = "https://github.com/NerdHubMC/FOML/issues" | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
if (project.hasProperty("maven_user") && project.hasProperty("maven_pass")) { | ||
maven { | ||
name = "Abused's Maven" | ||
url = findProperty("maven_url") | ||
credentials { | ||
username = findProperty("maven_user") | ||
password = findProperty("maven_pass") | ||
} | ||
authentication { | ||
basic(BasicAuthentication) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
tasks.publish.dependsOn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
plugins { | ||
id 'maven-publish' | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
maven { url = "https://oss.sonatype.org/content/repositories/releases/" } | ||
} | ||
|
||
dependencies { | ||
modCompile "de.javagl:obj:${javagl_version}" | ||
include "de.javagl:obj:${javagl_version}" | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = 'FOML' | ||
|
||
afterEvaluate { | ||
artifact(remapJar) { | ||
builtBy remapJar | ||
} | ||
} | ||
artifact sourcesJar | ||
pom { | ||
name = "FOML" | ||
url = "https://github.com/NerdHubMC/FOML" | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "https://github.com/NerdHubMC/FOML/blob/master/LICENSE.md" | ||
} | ||
} | ||
scm { | ||
url = "https://github.com/NerdHubMC/FOML" | ||
connection = "scm:git:git://github.com/NerdHubMC/FOML.git" | ||
developerConnection = "scm:git:git@github.com:NerdHubMC/FOML.git" | ||
} | ||
issueManagement { | ||
system = "github" | ||
url = "https://github.com/NerdHubMC/FOML/issues" | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
if (project.hasProperty("maven_user") && project.hasProperty("maven_pass")) { | ||
maven { | ||
name = "Abused's Maven" | ||
url = findProperty("maven_url") | ||
credentials { | ||
username = findProperty("maven_user") | ||
password = findProperty("maven_pass") | ||
} | ||
authentication { | ||
basic(BasicAuthentication) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
tasks.publish.dependsOn build |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
archivesBaseName = project.mod_name + '-test' | ||
|
||
dependencies { | ||
compile project(':foml-mod') | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,7 @@ pluginManagement { | |
gradlePluginPortal() | ||
} | ||
} | ||
|
||
rootProject.name = 'foml-root' | ||
|
||
include 'foml-mod', 'foml-test' |