Skip to content

Commit

Permalink
Merge pull request #603 from aloubyansky/augment-only-phase
Browse files Browse the repository at this point in the history
#602 extract RunnerJarPhase from AugmentPhase
  • Loading branch information
aloubyansky authored Jan 23, 2019
2 parents 299b89b + e1a0617 commit ae0c619
Show file tree
Hide file tree
Showing 9 changed files with 522 additions and 348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@

import org.jboss.shamrock.creator.AppCreator;
import org.jboss.shamrock.creator.phase.augment.AugmentPhase;
import org.jboss.shamrock.creator.phase.curate.PomStateCreationPhase;
import org.jboss.shamrock.creator.phase.curate.PomStateReadingPhase;
import org.jboss.shamrock.creator.phase.curate.CuratePhase;
import org.jboss.shamrock.creator.phase.nativeimage.NativeImageOutcome;
import org.jboss.shamrock.creator.phase.nativeimage.NativeImagePhase;
import org.jboss.shamrock.creator.phase.runnerjar.RunnerJarOutcome;
import org.jboss.shamrock.creator.phase.runnerjar.RunnerJarPhase;
import org.jboss.shamrock.creator.util.IoUtils;
import org.jboss.shamrock.creator.util.PropertyUtils;

Expand Down Expand Up @@ -68,42 +68,16 @@ public static void main(String[] args) throws Exception {
//buildNativeImage(appJar, demoDir);
//curateRunnableJar(appJar, demoDir);

logLibDiff(exampleTarget, demoDir);
}

private static void curateRunnableJar(Path userApp, Path outputDir) throws Exception {

try (AppCreator appCreator = AppCreator.builder()
.addPhase(new PomStateCreationPhase())
.addPhase(new PomStateReadingPhase())
.setAppJar(userApp)
.setWorkDir(outputDir)
.build()) {
appCreator.resolveOutcome(PomStateReadingPhase.Outcome.class);
}
/*
new AppCreator()
// enabling debug allows to see resolved application dependencies in the terminal
.setDebug(true)
// setting a work dir can be useful if you want to see the temporary content used
// by various phases during app building
.setWorkDir(outputDir)
.addPhase(new PomStateCreationPhase())
.addPhase(new PomStateReadingPhase())
//.addPhase(new CuratePhase())
//.addPhase(new AugmentPhase().setOutputDir(outputDir))
.create(userApp);
*/
//logLibDiff(exampleTarget, demoDir);
}

private static void buildRunnableJar(Path userApp, Path outputDir) throws Exception {

final RunnerJarOutcome runnerJar;
try (AppCreator appCreator = AppCreator.builder()
.addPhase(new CuratePhase())
.addPhase(new AugmentPhase()/*.setOutputDir(outputDir)*/)
.addPhase(new RunnerJarPhase()/*.setOutputDir(outputDir)*/)
.addPhase(new NativeImagePhase())
.setAppJar(userApp)
.build()) {
Expand All @@ -117,7 +91,9 @@ private static void buildNativeImage(Path userApp, Path outputDir) throws Except

try (AppCreator appCreator = AppCreator.builder()
//.setOutput(outputDir)
.addPhase(new CuratePhase())
.addPhase(new AugmentPhase())
.addPhase(new RunnerJarPhase())
.addPhase(new NativeImagePhase().setOutputDir(outputDir))
.setAppJar(userApp)
.build()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.jboss.shamrock.creator.phase.augment;

import java.nio.file.Path;
import org.jboss.shamrock.creator.AppDependency;

/**
*
Expand All @@ -27,5 +28,9 @@ public interface AugmentOutcome {

Path getAppClassesDir();

Path getTransformedClassesDir();

Path getWiringClassesDir();

boolean isWhitelisted(AppDependency dep);
}
Loading

0 comments on commit ae0c619

Please sign in to comment.