-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1306 from Friendseeker/build-source-info
[1.x] Emit `SourceInfos` when incremental compilation fails
- Loading branch information
Showing
10 changed files
with
171 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
internal/compiler-interface/src/main/java/xsbti/AnalysisCallback3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Zinc - The incremental compiler for Scala. | ||
* Copyright Scala Center, Lightbend, and Mark Harrah | ||
* | ||
* Licensed under Apache License 2.0 | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
*/ | ||
|
||
package xsbti; | ||
import xsbti.compile.analysis.ReadSourceInfos; | ||
|
||
/** | ||
* Extension to {@link AnalysisCallback2}. | ||
* Similar to {@link AnalysisCallback2}, it serves as compatibility layer for Scala compilers. | ||
*/ | ||
public interface AnalysisCallback3 extends AnalysisCallback2 { | ||
ReadSourceInfos getSourceInfos(); | ||
} |
22 changes: 22 additions & 0 deletions
22
internal/compiler-interface/src/main/java/xsbti/CompileFailed2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Zinc - The incremental compiler for Scala. | ||
* Copyright Scala Center, Lightbend, and Mark Harrah | ||
* | ||
* Licensed under Apache License 2.0 | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
*/ | ||
|
||
package xsbti; | ||
|
||
import xsbti.compile.analysis.ReadSourceInfos; | ||
|
||
public abstract class CompileFailed2 extends CompileFailed { | ||
/** | ||
* Returns SourceInfos containing problems for each file. | ||
* This includes problems found by most recent compilation run. | ||
*/ | ||
public abstract ReadSourceInfos sourceInfos(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
internal/zinc-testing/src/main/scala/xsbti/TestSourceInfo.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Zinc - The incremental compiler for Scala. | ||
* Copyright Scala Center, Lightbend, and Mark Harrah | ||
* | ||
* Licensed under Apache License 2.0 | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
*/ | ||
|
||
package xsbti | ||
|
||
import xsbti.compile.analysis.SourceInfo | ||
|
||
class TestSourceInfo extends SourceInfo { | ||
|
||
override def getReportedProblems: Array[Problem] = Array.empty[Problem] | ||
|
||
override def getUnreportedProblems: Array[Problem] = Array.empty[Problem] | ||
|
||
override def getMainClasses: Array[String] = Array.empty[String] | ||
} |
24 changes: 24 additions & 0 deletions
24
internal/zinc-testing/src/main/scala/xsbti/TestSourceInfos.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Zinc - The incremental compiler for Scala. | ||
* Copyright Scala Center, Lightbend, and Mark Harrah | ||
* | ||
* Licensed under Apache License 2.0 | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
*/ | ||
|
||
package xsbti | ||
|
||
import xsbti.compile.analysis.{ ReadSourceInfos, SourceInfo } | ||
|
||
import java.util | ||
|
||
class TestSourceInfos extends ReadSourceInfos { | ||
|
||
override def get(sourceFile: VirtualFileRef): SourceInfo = new TestSourceInfo | ||
|
||
override def getAllSourceInfos: util.Map[VirtualFileRef, SourceInfo] = | ||
new util.HashMap[VirtualFileRef, SourceInfo]() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters