Skip to content

Commit f149620

Browse files
committed
Remove logging and rename
1 parent 5d95a6d commit f149620

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

jabel-javac-plugin/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ sourceCompatibility = targetCompatibility = 8
88
dependencies {
99
compile 'net.bytebuddy:byte-buddy:1.10.8'
1010
compile 'net.bytebuddy:byte-buddy-agent:1.10.8'
11-
compile 'org.apache.maven:maven-plugin-api:3.0'
1211
}

jabel-javac-plugin/src/main/java/com/github/bsideup/jabel/JabelJavacProcessor.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import net.bytebuddy.agent.ByteBuddyAgent;
99
import net.bytebuddy.asm.Advice;
1010
import net.bytebuddy.dynamic.loading.ClassReloadingStrategy;
11-
import org.apache.maven.plugin.logging.SystemStreamLog;
1211

1312
import javax.annotation.processing.Completion;
1413
import javax.annotation.processing.ProcessingEnvironment;
@@ -31,7 +30,6 @@
3130
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
3231

3332
public class JabelJavacProcessor implements Processor {
34-
private static org.apache.maven.plugin.logging.Log log = new SystemStreamLog();
3533

3634
/**
3735
* Set of the all the features we want to force enable in our 8 target
@@ -69,12 +67,12 @@ public class JabelJavacProcessor implements Processor {
6967
static {
7068
// log that we've started, otherwise if there's certain types of errors, no output is seen at all from Jabel (e.g. errors compiling our code)
7169
// helps for verifying Jabel is being picked up correctly from project settings
72-
log.info("Jabel static initialising ByteBuddy");
70+
logInfo("Jabel static initialising ByteBuddy");
7371

7472
ByteBuddyAgent.install();
7573
ByteBuddy byteBuddy = new ByteBuddy();
7674

77-
log.info("Disabling source level check");
75+
logInfo("Disabling source level check");
7876
/**
7977
* Inject our code into the JDK version checks
8078
*
@@ -92,15 +90,15 @@ public class JabelJavacProcessor implements Processor {
9290
.load(clazz.getClassLoader(), ClassReloadingStrategy.fromInstalledAgent());
9391
}
9492

95-
log.info("Disabling preview feature flag checks");
93+
logInfo("Disabling preview feature flag checks");
9694
// force javac to think no features are previews
9795
Class<Preview> previewClass = Preview.class;
9896
byteBuddy.redefine(previewClass)
99-
.visit(Advice.to(PreviewFeatureCheckOverride.class).on(named("isPreview")))
97+
.visit(Advice.to(PreviewAdvice.class).on(named("isPreview")))
10098
.make()
10199
.load(previewClass.getClassLoader(), ClassReloadingStrategy.fromInstalledAgent());
102100

103-
log.info("Disabling feature min level checks");
101+
logInfo("Disabling feature min level checks");
104102
/**
105103
* For all the features in {@link #ENABLED_FEATURES}, override the min JDK level, reducing it to 8
106104
*
@@ -120,7 +118,11 @@ public class JabelJavacProcessor implements Processor {
120118
} catch (Exception e) {
121119
throw new RuntimeException(e);
122120
}
123-
log.info("Jabel ByteBuddy initialisation complete");
121+
logInfo("Jabel ByteBuddy initialisation complete");
122+
}
123+
124+
static private void logInfo(String msg) {
125+
System.out.println(msg);
124126
}
125127

126128
@Override
@@ -130,7 +132,7 @@ public SourceVersion getSupportedSourceVersion() {
130132

131133
@Override
132134
public void init(ProcessingEnvironment processingEnv) {
133-
log.debug(
135+
logInfo(
134136
ENABLED_FEATURES.stream()
135137
.map(Enum::name)
136138
.collect(Collectors.joining(

jabel-javac-plugin/src/main/java/com/github/bsideup/jabel/PreviewFeatureCheckOverride.java renamed to jabel-javac-plugin/src/main/java/com/github/bsideup/jabel/PreviewAdvice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.sun.tools.javac.code.Source;
55
import net.bytebuddy.asm.Advice;
66

7-
public class PreviewFeatureCheckOverride {
7+
public class PreviewAdvice {
88

99
static final boolean debug = false;
1010

0 commit comments

Comments
 (0)