File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
app/src/main/java/com/diffplug/spotless/cli/core Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 2525import com .diffplug .spotless .JarState ;
2626import com .diffplug .spotless .Provisioner ;
2727
28+ /**
29+ * Since we are not a build tool per se, we do not actually have a provisioning
30+ * method other than our app bundle itself. And as we want to compile to native
31+ * we cannot use dynamic class loading. So override spotless-lib dynamic class loading
32+ * to actually use only classes within our distribution.
33+ */
2834public class CliJarProvisioner implements Provisioner {
2935
3036 public static final CliJarProvisioner INSTANCE = new CliJarProvisioner ();
3137
3238 public static final File OWN_JAR = createSentinelFile ();
3339
3440 public CliJarProvisioner () {
35- JarState .setOverrideClassLoader (getClass ().getClassLoader ()); // use the classloader of this class
36- // TODO (simschla, 11.11.2024): THIS IS A HACK, replace with proper solution
41+ JarState .setForcedClassLoader (getClass ().getClassLoader ()); // use the classloader of this class
3742 }
3843
3944 private static File createSentinelFile () {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ durian = "1.2.0"
55junit = " 5.8.1"
66native-include-googleJavaFormat = " 1.24.0"
77picocli = " 4.7.6"
8- spotless-lib = " 3.0.2 -SNAPSHOT"
8+ spotless-lib = " 3.1.0 -SNAPSHOT"
99
1010[libraries ]
1111annotations = { module = " org.jetbrains:annotations" , version.ref = " annotations" }
You can’t perform that action at this time.
0 commit comments