Skip to content

Commit

Permalink
gradle build now works as expected, automatically runs the CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrarSyed committed Aug 9, 2015
1 parent 379f05b commit 9be05d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
13 changes: 7 additions & 6 deletions src/main/java/net/minecraftforge/gradle/user/UserBasePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,13 @@ protected void makeDecompTasks(final String globalPattern, final String localPat
@Override
public void execute(Project project)
{
boolean isDecomp = false;

if (project.file(recompiledJar).exists())
// the recompiled jar exists, or the decomp task is part of the build
boolean isDecomp = project.file(recompiledJar).exists() || project.getGradle().getStartParameter().getTaskNames().contains(TASK_SETUP_DECOMP);

// set task dependencies
if (!isDecomp)
{
isDecomp = true;
project.getTasks().getByName("compileJava").dependsOn(UserConstants.TASK_DEOBF_BIN);
}

afterDecomp(isDecomp, useLocalCache(getExtension()), CONFIG_MC);
Expand Down Expand Up @@ -466,8 +468,7 @@ protected void configureCompilation()
test.setRuntimeClasspath(test.getRuntimeClasspath()
.plus(api.getOutput())
.plus(project.getConfigurations().getByName(CONFIG_MC))
.plus(project.getConfigurations().getByName(CONFIG_MC_DEPS))
.plus(project.getConfigurations().getByName(CONFIG_START)));
.plus(project.getConfigurations().getByName(CONFIG_MC_DEPS)));

project.getConfigurations().getByName("compile").extendsFrom(project.getConfigurations().getByName(CONFIG_DC_RESOLVED));
project.getConfigurations().getByName(CONFIG_PROVIDED).extendsFrom(project.getConfigurations().getByName(CONFIG_DP_RESOLVED));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
package net.minecraftforge.gradle.user.patcherUser;

import static net.minecraftforge.gradle.common.Constants.*;
import static net.minecraftforge.gradle.common.Constants.DIR_JSONS;
import static net.minecraftforge.gradle.common.Constants.JAR_MERGED;
import static net.minecraftforge.gradle.common.Constants.MCP_PATCHES_MERGED;
import static net.minecraftforge.gradle.common.Constants.TASK_DL_VERSION_JSON;
import static net.minecraftforge.gradle.common.Constants.TASK_GENERATE_SRGS;
import static net.minecraftforge.gradle.common.Constants.TASK_MERGE_JARS;
import static net.minecraftforge.gradle.user.UserConstants.*;
import static net.minecraftforge.gradle.user.patcherUser.PatcherUserConstants.*;
import groovy.lang.Closure;

import java.io.File;

import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.SourceSet;

import com.google.common.collect.ImmutableMap;

import groovy.lang.Closure;
import net.minecraftforge.gradle.tasks.DeobfuscateJar;
import net.minecraftforge.gradle.tasks.ExtractConfigTask;
import net.minecraftforge.gradle.tasks.PatchSourcesTask;
Expand All @@ -17,13 +29,6 @@
import net.minecraftforge.gradle.user.UserBasePlugin;
import net.minecraftforge.gradle.util.delayed.TokenReplacer;

import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.SourceSet;

import com.google.common.collect.ImmutableMap;

public abstract class PatcherUserBasePlugin<T extends UserBaseExtension> extends UserBasePlugin<T>
{
@Override
Expand Down

0 comments on commit 9be05d7

Please sign in to comment.