File tree 2 files changed +8
-3
lines changed
app/src/main/java/com/diffplug/spotless/cli/core
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 25
25
import com .diffplug .spotless .JarState ;
26
26
import com .diffplug .spotless .Provisioner ;
27
27
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
+ */
28
34
public class CliJarProvisioner implements Provisioner {
29
35
30
36
public static final CliJarProvisioner INSTANCE = new CliJarProvisioner ();
31
37
32
38
public static final File OWN_JAR = createSentinelFile ();
33
39
34
40
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
37
42
}
38
43
39
44
private static File createSentinelFile () {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ durian = "1.2.0"
5
5
junit = " 5.8.1"
6
6
native-include-googleJavaFormat = " 1.24.0"
7
7
picocli = " 4.7.6"
8
- spotless-lib = " 3.0.2 -SNAPSHOT"
8
+ spotless-lib = " 3.1.0 -SNAPSHOT"
9
9
10
10
[libraries ]
11
11
annotations = { module = " org.jetbrains:annotations" , version.ref = " annotations" }
You can’t perform that action at this time.
0 commit comments