Skip to content

Commit

Permalink
Now using LibLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
LunNova committed May 12, 2017
1 parent f1eb163 commit 5be8fc5
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 481 deletions.
66 changes: 6 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ buildscript {
configurations.all { resolutionStrategy.cacheChangingModulesFor 30, 'seconds' }
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath group: 'me.nallar', name: 'ModPatcherGradle', version: '0.1-SNAPSHOT', changing: true
classpath 'me.nallar:ModPatcherGradle:0.1-SNAPSHOT'
classpath 'me.nallar.libloader:LibLoaderGradle:0.1-SNAPSHOT'
}
}
apply plugin: 'me.nallar.ModPatcherGradle'
apply plugin: 'me.nallar.libloader.LibLoaderGradle'
apply plugin: 'maven'

group = 'me.nallar'
Expand Down Expand Up @@ -50,10 +52,6 @@ ext.commit = System.getenv("GIT_COMMIT") ?: 'unknown'
version = mcVersion + '-SNAPSHOT'

ext.versionWithBuildNumber = project.buildNumber != 0 ? project.version.replace("-SNAPSHOT", "") + "." + project.buildNumber : project.version
ext.versionPath = "./build/version.txt"

def versionFile = file(versionPath)
versionFile.getParentFile().mkdir()

minecraft {
version = fullForgeVersion
Expand Down Expand Up @@ -86,10 +84,10 @@ configurations {

dependencies {
testCompile 'junit:junit:4.12'
compile group: 'me.nallar', name: 'JavaPatcher', version: '1.4', changing: false
compile group: 'me.nallar', name: 'Mixin', version: '1.0-SNAPSHOT', changing: true
libLoader group: 'me.nallar', name: 'JavaPatcher', version: '1.4', changing: false
libLoader group: 'me.nallar', name: 'Mixin', version: '1.0-SNAPSHOT', changing: true
libLoader 'org.javassist:javassist:3.22.0-CR1'
provided group: 'me.nallar', name: 'CachingClassLoader', version: '0.1-SNAPSHOT', changing: true
compile 'org.javassist:javassist:3.22.0-CR1'
}

if (System.env.GRADLE_USER_HOME) {
Expand Down Expand Up @@ -139,12 +137,6 @@ static File lzma(String name) {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from((configurations.runtime - configurations.provided).filter { it.exists() }.collect {
it.isDirectory() ? it : zipTree(it)
}) {
exclude "META-INF/**"
exclude "org/objectweb/asm/**"
}
from lzma(mappingsPath + 'methods.csv')
from lzma(mappingsPath + 'fields.csv')
from './generated/extendsMap.obj.lzma'
Expand All @@ -156,7 +148,6 @@ processResources {
inputs.property "version", project.versionWithBuildNumber
inputs.property "mcversion", project.minecraft.version
println("Determined ModPatcher version: " + project.versionWithBuildNumber)
versionFile.text = project.versionWithBuildNumber

filesMatching("mcmod.info") {
expand 'version': project.versionWithBuildNumber, 'mcversion': project.minecraft.version, 'name': project.projectName
Expand All @@ -175,50 +166,6 @@ tasks.withType(JavaCompile) {
}
}

jar {
classifier = 'lib'
}

def apiJarConfig = {
classifier = 'api'
from {
sourceSets.main.allSource
sourceSets.main.output
} {
include 'me/nallar/modpatcher/api/*'
}
}

task apiJar(type: Jar, dependsOn: classes)

apiJar apiJarConfig

task coremodJar(type: Jar, dependsOn: classes)

coremodJar apiJarConfig
coremodJar {
classifier = 'coremod'
include 'me/nallar/modpatcher/coremod/*'
include 'mcmod.info'
include '*.example'
}

artifacts {
archives apiJar
archives coremodJar
archives jar
archives file(versionPath)
}

def installer = install.repositories.mavenInstaller

[installer]*.pom*.whenConfigured {
p ->
p.dependencies = p.dependencies.findAll {
dep -> dep.artifactId == "junit"
}
}

tasks.withType(Jar) {
baseName = project.name
manifest.mainAttributes(
Expand All @@ -227,7 +174,6 @@ tasks.withType(Jar) {
"Implementation-Title": name,
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
"Implementation-Vendor": url,
"FMLCorePlugin": "me.nallar.modpatcher.coremod.CoreMod"
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/javassist/ClassLoaderPool.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package javassist;

import me.nallar.modpatcher.internal.LaunchClassLoaderUtil;
import me.nallar.modpatcher.internal.PatcherLog;
import me.nallar.modpatcher.api.LaunchClassLoaderUtil;
import me.nallar.modpatcher.api.PatcherLog;

import java.io.*;
import java.net.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.nallar.modpatcher.internal;
package me.nallar.modpatcher.api;

import LZMA.LzmaInputStream;
import lombok.SneakyThrows;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.nallar.modpatcher.internal;
package me.nallar.modpatcher.api;

import LZMA.LzmaInputStream;
import com.google.common.collect.BiMap;
Expand Down

0 comments on commit 5be8fc5

Please sign in to comment.