Skip to content
This repository has been archived by the owner. It is now read-only.

Commit c7541ab

Browse files
committed
Move CompilerBridgeProvider.constant into ZincCompilerUtil
On both my local machine and on Drone box, `ZincComponentCompilerSpec` fails to compile 2.10 compiler bridge with the following error: ``` /T/sbt_1234/xsbti/compile/CompilerBridgeProvider.java:33: error: `;' expected but `{' found. static CompilerBridgeProvider constant(File file, ScalaInstance scalaInstance) { ^ ``` I suspected that this is due to Java `interface` defining a static method, a change introduced in only in Java 8. After making this change, the spec passed the test.
1 parent e133763 commit c7541ab

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

src/main/java/xsbti/compile/CompilerBridgeProvider.java

-40
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
package xsbti.compile;
99

10-
import xsbti.F0;
1110
import xsbti.Logger;
12-
1311
import java.io.File;
1412

1513
/**
@@ -20,44 +18,6 @@
2018
* compile them and then define the sbt component, which is reused across different sbt projects.
2119
*/
2220
public interface CompilerBridgeProvider {
23-
24-
/**
25-
* Defines a constant {@link CompilerBridgeProvider} that returns an already compiled bridge.
26-
* <p>
27-
* This method is useful for external build tools that want full control over the retrieval
28-
* and compilation of the compiler bridge, as well as the Scala instance to be used.
29-
*
30-
* @param file The jar or directory of the compiled Scala bridge.
31-
* @return A provider that always returns the same compiled bridge.
32-
*/
33-
static CompilerBridgeProvider constant(File file, ScalaInstance scalaInstance) {
34-
return new CompilerBridgeProvider() {
35-
@Override
36-
public File fetchCompiledBridge(ScalaInstance scalaInstance, Logger logger) {
37-
logger.debug(new F0<String>() {
38-
@Override
39-
public String apply() {
40-
String bridgeName = file.getAbsolutePath();
41-
return "Returning already retrieved and compiled bridge: " + bridgeName + ".";
42-
}
43-
});
44-
return file;
45-
}
46-
47-
@Override
48-
public ScalaInstance fetchScalaInstance(String scalaVersion, Logger logger) {
49-
logger.debug(new F0<String>() {
50-
@Override
51-
public String apply() {
52-
String instance = scalaInstance.toString();
53-
return "Returning default scala instance:\n\t" + instance;
54-
}
55-
});
56-
return scalaInstance;
57-
}
58-
};
59-
}
60-
6121
/**
6222
* Get the location of the compiled Scala compiler bridge for a concrete Scala version.
6323
*

0 commit comments

Comments
 (0)