Skip to content
Browse files

Re #1000631. Code clean-up and clean merge with release/scala-ide-2.0.x

  • Loading branch information...
1 parent 090882b commit d3ec008fe64355c88e9a488bbe3252a3a434538d @skyluc skyluc committed
View
18 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaBuilder.scala
@@ -6,9 +6,7 @@
package scala.tools.eclipse
import scala.collection.mutable.HashSet
-
import java.{ lang => jl, util => ju }
-
import org.eclipse.core.resources.{ IFile, IncrementalProjectBuilder, IProject, IResource, IResourceDelta, IResourceDeltaVisitor, IResourceVisitor }
import org.eclipse.core.runtime.{ IProgressMonitor, IPath, SubMonitor }
import org.eclipse.jdt.internal.core.JavaModelManager
@@ -16,8 +14,9 @@ import org.eclipse.jdt.internal.core.builder.{ JavaBuilder, State }
import scala.tools.eclipse.javaelements.JDTUtils
import scala.tools.eclipse.util.{ FileUtils, ReflectionUtils }
+import util.HasLogger
-class ScalaBuilder extends IncrementalProjectBuilder {
+class ScalaBuilder extends IncrementalProjectBuilder with HasLogger {
def plugin = ScalaPlugin.plugin
private val scalaJavaBuilder = new GeneralScalaJavaBuilder
@@ -74,8 +73,17 @@ class ScalaBuilder extends IncrementalProjectBuilder {
// Only for sbt which is able to track external dependencies properly
project.buildManager match {
case _: EclipseSbtBuildManager =>
- if (project.externalDepends.exists(
- x => { val delta = getDelta(x); delta == null || delta.getKind != IResourceDelta.NO_CHANGE})) {
+
+ def hasChanges(prj: IProject): Boolean = {
+ val delta = getDelta(prj)
+ delta == null || delta.getKind != IResourceDelta.NO_CHANGE
+ }
+
+ if (project.externalDepends.exists(hasChanges)) {
+ // reset presentation compilers if a dependency has been rebuilt
+ logger.debug("Resetting presentation compiler for %s due to dependent project change".format(project.underlying.getName()))
+ project.resetPresentationCompiler
+
// in theory need to be able to identify the exact dependencies
// but this is deeply rooted inside the sbt dependency tracking mechanism
// so we just tell it to have a look at all the files
View
2 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPlugin.scala
@@ -140,7 +140,7 @@ class ScalaPlugin extends AbstractUIPlugin with IResourceChangeListener with IEl
diagnostic.StartupDiagnostics.run
}
JavaCore.addElementChangedListener(this)
- println("Scala compiler bundle: " + scalaCompilerBundle.getLocation)
+ logger.info("Scala compiler bundle: " + scalaCompilerBundle.getLocation)
}
override def stop(context: BundleContext) = {
View
20 org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaProject.scala
@@ -346,23 +346,7 @@ class ScalaProject(val underlying: IProject) extends HasLogger {
case _ =>
}
}
-
-// /** Check if the .classpath file has been changed since the last check.
-// * If the saved timestamp does not match the file timestamp, reset the
-// * two compilers.
-// */
-// def checkClasspathTimeStamp(shouldReset: Boolean): Unit = plugin.check {
-// val cp = underlying.getFile(".classpath")
-// if (cp.exists)
-// classpathUpdate match {
-// case IResource.NULL_STAMP => classpathUpdate = cp.getModificationStamp()
-// case stamp if stamp == cp.getModificationStamp() =>
-// case _ =>
-// classpathUpdate = cp.getModificationStamp()
-// if (shouldReset) resetCompilers()
-// }
-// }
-
+
/**
* Manage the possible classpath error/warning reported on the project.
*/
@@ -497,7 +481,7 @@ class ScalaProject(val underlying: IProject) extends HasLogger {
setting <- box.userSettings; if filter(setting)
) {
val value0 = store.getString(SettingConverterUtil.convertNameToProperty(setting.name))
- logger.info("[%s] initializing %s to %s".format(underlying.getName(), setting.name, value0.toString))
+// logger.info("[%s] initializing %s to %s".format(underlying.getName(), setting.name, value0.toString))
try {
val value = if (setting ne settings.pluginsDir) value0 else {
ScalaPlugin.plugin.continuationsClasses map {

0 comments on commit d3ec008

Please sign in to comment.
Something went wrong with that request. Please try again.