Skip to content

Commit

Permalink
Generate External Patches before build starts
Browse files Browse the repository at this point in the history
  • Loading branch information
JaciBrunning committed Apr 15, 2015
1 parent 17a107e commit f4048c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ task genJavadoc(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

task generateExternalPatches(type: GradleBuild) {
dir = 'patches'
tasks = ['genPatches']
}

task genPatches << {
try {
ant.copy(todir: "build/resources/main/assets/toast/patches/") {
Expand All @@ -114,6 +119,7 @@ task updateLatest << {
ant.copy(file: "${jar.archivePath}", todir: "build/latest")
}

deletePatches.dependsOn generateExternalPatches
genPatches.dependsOn deletePatches
compileJava.dependsOn genPatches
build.finalizedBy updateLatest
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/jaci/openrio/toast/core/ToastBootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import jaci.openrio.toast.lib.log.SysLogProxy;

import java.io.File;
import java.util.Arrays;

/**
* The Bootstrap class for launching Toast before WPILib. This makes simulation, class patching, crash handling
Expand Down Expand Up @@ -88,6 +89,8 @@ public static void main(String[] args) {
new GlobalBlackboard();
SysLogProxy.init();

if (args != null && args.length > 0)
toastLogger.info("Toast Started with Run Arguments: " + Arrays.toString(args));
toastLogger.info("Slicing Loaf...");

ClassPatcher classLoader = new ClassPatcher();
Expand Down

0 comments on commit f4048c8

Please sign in to comment.