Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotations processing for client.json generation and checking at compile-time. #14

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Minecraft uses Maven to download dependencies, EMC is loaded as a dependency. To

```
{
"name": "me.deftware:EMC:13.1.0",
"url": "https://github.com/Moudoux/EMC/raw/master/maven/"
"name": "com.github.Moudoux:EMC:13.1.0",
"url": "https://jitpack.io/"
}
```

Expand Down
51 changes: 15 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
url = 'http://repo.spongepowered.org/maven'
}
maven {
url "https://plugins.gradle.org/m2/"
url = "https://plugins.gradle.org/m2/"
}
}

Expand All @@ -20,9 +20,9 @@ buildscript {
}
}

version '13.1.6'
def minecraftVersion = "1.12.2";
def forgeVersion = "-14.23.2.2611";
version = '13.1.6'
def minecraftVersion = "1.12.2"
def forgeVersion = "-14.23.2.2611"
def forgeBuild = true

apply plugin: 'maven'
Expand All @@ -35,7 +35,7 @@ if (forgeBuild) {
apply plugin: 'org.spongepowered.mixin'
apply plugin: "com.github.johnrengelman.shadow"

group 'me.deftware'
group = 'me.deftware'

sourceCompatibility = targetCompatibility = 1.8
compileJava {
Expand All @@ -49,7 +49,7 @@ minecraft {
useDepAts = true
makeObfSourceJar = true
if (!forgeBuild) {
tweakClass = 'me.deftware.launch.Launcher'
tweakClass = 'me.deftware.launch.Launcher'
}
}

Expand Down Expand Up @@ -78,38 +78,22 @@ dependencies {
}

mixin {
defaultObfuscationEnv forgeBuild ? searge : notch
defaultObfuscationEnv = forgeBuild ? searge : notch
add sourceSets.main, "mixins.client.refmap.json"
}

shadowJar {
dependencies {
include(dependency('org.spongepowered:mixin'))
}
classifier = 'full'
}

task createPom << {
pom {
project {
groupId "me.deftware"
artifactId "EMC"
version "${version}-${minecraftVersion}"
}
}.writeTo("maven/me/deftware/EMC/${version}-${minecraftVersion}/EMC-${version}-${minecraftVersion}.pom")
}

task copyBuilds(type: Copy) {
from "$rootDir/build/libs"
into "$rootDir/maven/me/deftware/" + (forgeBuild ? "EMC-Forge" : "EMC") + "/${version}-${minecraftVersion}/"
if (forgeBuild) {
rename { String fileName ->
fileName.replace("EMC", "EMC-Forge")
}
manifest {
attributes 'Implementation-Title': 'EMC'
attributes 'Implementation-Version': version
}
rename { String fileName ->
fileName.replace(version, "${version}-${minecraftVersion}")
}

exclude 'dummyThing'
exclude 'LICENSE.txt'
classifier = 'full'
}

reobf {
Expand All @@ -134,13 +118,8 @@ if (forgeBuild) {
println "Building for Minecraft..."
}

delete "$rootDir/build/libs"
delete "$rootDir/maven/me/deftware/" + (forgeBuild ? "EMC-Forge" : "EMC") + "/${version}-${minecraftVersion}"
build.dependsOn(shadowJar)
if (!forgeBuild) {
build.dependsOn(createPom)
}
build.dependsOn(copyBuilds)
compileTestJava.dependsOn(shadowJar)

tasks.build.doLast(){
if (forgeBuild) {
Expand Down
4 changes: 2 additions & 2 deletions example_client.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"name": "net.minecraft:launchwrapper:1.12"
},
{
"name": "me.deftware:EMC:13.1.0",
"url": "https://github.com/Moudoux/EMC/raw/master/maven/"
"name": "com.github.Moudoux:EMC:13.1.0",
"url": "https://jitpack.io/"
},
{
"name": "org.spongepowered:mixin:0.7.1-SNAPSHOT",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 0 additions & 34 deletions maven/me/deftware/EMC/13.1.6-1.12.2/EMC-13.1.6-1.12.2.pom

This file was deleted.

Binary file removed maven/me/deftware/EMC/13.1.6/EMC-13.1.6-full.jar
Binary file not shown.
Binary file removed maven/me/deftware/EMC/13.1.6/EMC-13.1.6-sources.jar
Binary file not shown.
Binary file removed maven/me/deftware/EMC/13.1.6/EMC-13.1.6.jar
Binary file not shown.
34 changes: 0 additions & 34 deletions maven/me/deftware/EMC/13.1.6/EMC-13.1.6.pom

This file was deleted.

28 changes: 28 additions & 0 deletions src/main/java/me/deftware/mixin/annotations/ModInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package me.deftware.mixin.annotations;

import me.deftware.client.framework.main.EMCMod;

import javax.annotation.Nonnull;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@SuppressWarnings("unused")
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface ModInfo {
@Nonnull String name();

@Nonnull String website();

@Nonnull String author();

@Nonnull Class<? extends EMCMod> main();

boolean updateLinkOverride();

double minversion();

double version();
}
Loading