Permalink
Browse files

First clean-up pass

  • Loading branch information...
1 parent e179e77 commit 5f76810a4c27fc59d943ffedceaa65bbc079bf20 @skyluc skyluc committed Jul 24, 2012
@@ -56,7 +56,9 @@ SUCH DAMAGE.
</url>
<requires>
- <import feature="org.scala-ide.sdt.feature"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.scala-ide.scala.library"/>
</requires>
<plugin
@@ -7,9 +7,5 @@ Bundle-Vendor: $providerName$
Fragment-Host: $pluginName$
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.scala-ide.scala.library,
- org.eclipse.equinox.weaving.aspectj,
- org.junit4;bundle-version="4.5.0",
- org.scala-ide.sdt.core
-Import-Package: scala.tools.eclipse.testsetup,
- org.aspectj.weaver.loadtime.definition
+ org.junit4;bundle-version="4.5.0"
Bundle-ClassPath: .
@@ -1,5 +1,4 @@
source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
- test-workspace/,\
.
@@ -2,16 +2,17 @@ package $pluginName$
import org.junit.Test
import org.junit.Assert._
-import scala.tools.eclipse.testsetup.TestProjectSetup
-class SomeInterestingCodeTest extends TestProjectSetup("aProject", bundleName= "$pluginName$.tests") {
+class SomeInterestingCodeTest {
@Test
- def numberOfTypes() {
- val compilationUnit= scalaCompilationUnit("org/example/ScalaClass.scala")
-
- assertEquals("Wrong number of types", 2, SomeInterestingCode.numberOfTypes(compilationUnit))
-
+ def div() {
+ assertEquals("Bad result for '12/3'", Some(4), SomeInterestingCode.div(12, 3))
+ }
+
+ @Test
+ def divByZero {
+ assertEquals("Bad result for '10/0'", None, SomeInterestingCode.div(10, 0))
}
}
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>aProject</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.scala-ide.sdt.core.scalabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.scala-ide.sdt.core.scalanature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
@@ -1,9 +0,0 @@
-package org.example
-
-class ScalaClass {
-
-}
-
-object ScalaClass {
-
-}
@@ -8,25 +8,7 @@ Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Require-Bundle:
org.eclipse.core.runtime,
- org.eclipse.debug.ui,
- org.eclipse.help,
- org.eclipse.jdt.core;bundle-version="[3.6.0,3.7.10)",
- org.eclipse.jdt.debug.ui,
- org.eclipse.jdt.junit,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui,
- org.eclipse.jface.text,
org.eclipse.ui,
- org.eclipse.ui.console,
- org.eclipse.ui.editors,
- org.eclipse.ui.forms,
- org.eclipse.ui.ide,
- org.scala-ide.scala.library,
- org.scala-ide.scala.compiler,
- org.scala-ide.sdt.core;bundle-version="[2.0.0, 2.2.0)"
-Import-Package:
- com.ibm.icu.text;apply-aspects:=false;org.eclipse.swt.graphics;apply-aspects:=false,
- scala.tools.eclipse;apply-aspects:=false,
- scala.tools.eclipse.contribution.weaving.jdt.ui.javaeditor.formatter;apply-aspects:=false
+ org.scala-ide.scala.library
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
@@ -1,6 +1,7 @@
source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
+ icons/,
.,\
plugin.xml,\
plugin.properties
@@ -1,13 +1,11 @@
package $pluginName$
-import org.eclipse.ui.IWorkbenchWindowActionDelegate
import org.eclipse.jface.action.IAction
+import org.eclipse.jface.dialogs.MessageDialog
import org.eclipse.jface.viewers.ISelection
import org.eclipse.ui.IWorkbenchWindow
-import org.eclipse.ui.IFileEditorInput
-import scala.tools.eclipse.ScalaPlugin
-import org.eclipse.core.resources.IFile
-import org.eclipse.jface.dialogs.MessageDialog
+
+import org.eclipse.ui.IWorkbenchWindowActionDelegate
class $className$ extends IWorkbenchWindowActionDelegate {
@@ -21,29 +19,13 @@ class $className$ extends IWorkbenchWindowActionDelegate {
}
def run(action: IAction) {
- val activeEditor = window.getActivePage.getActiveEditor
- if (activeEditor != null) {
- activeEditor.getEditorInput match {
- case fei: IFileEditorInput =>
- display(fei.getFile)
- }
- }
- }
-
- def selectionChanged(action: IAction, selection: ISelection) {
- }
-
- def display(file: IFile) {
MessageDialog.openInformation(
window.getShell(),
"TestPDE",
- getProjectName(file)
- .map("The Scala project for the current editor is %s".format(_))
- .getOrElse("The current editor is not part of a Scala project"))
+ "Welcome in the Scala world")
}
- def getProjectName(file: IFile): Option[String] = {
- ScalaPlugin.plugin.asScalaProject(file.getProject).map(_.underlying.getName)
+ def selectionChanged(action: IAction, selection: ISelection) {
}
-}
+}
@@ -4,8 +4,11 @@ import scala.tools.eclipse.javaelements.ScalaCompilationUnit
object SomeInterestingCode {
- def numberOfTypes(scalaCompilationUnit: ScalaCompilationUnit): Int = {
- scalaCompilationUnit.getCompilationUnit.getAllTypes.length
+ def div(a: Int, b: Int): Option[Int] = {
+ if (b == 0) {
+ None
+ } else {
+ Some(a / b)
+ }
}
-
-}
+}
View
@@ -0,0 +1,2 @@
+.cache
+target/
View
@@ -24,7 +24,6 @@
<!-- p2 repositories location -->
<repo.eclipse.indigo>http://download.eclipse.org/releases/indigo/</repo.eclipse.indigo>
<repo.eclipse.juno>http://download.eclipse.org/releases/juno/</repo.eclipse.juno>
- <repo.ajdt.indigo>http://download.eclipse.org/tools/ajdt/37/dev/update</repo.ajdt.indigo>
<repo.scala-ide.root>http://download.scala-ide.org</repo.scala-ide.root>
<!-- fixed versions -->
@@ -33,14 +32,11 @@
<!-- tycho test related -->
<tycho.test.OSspecific></tycho.test.OSspecific>
- <!-- Partial workaround against JDT Weaving deadlocks. See #1000317 and the original ticket on https://issuetracker.springsource.com/browse/STS-1445 -->
- <tycho.test.weaving>-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dosgi.classloader.lock=classname</tycho.test.weaving>
<tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m -Dsdtcore.headless \${tycho.test.weaving} \${tycho.test.OSspecific}</tycho.test.jvmArgs>
<!-- dependencies repos -->
<eclipse.codename>indigo</eclipse.codename>
<repo.eclipse>\${repo.eclipse.indigo}</repo.eclipse>
- <repo.ajdt>\${repo.ajdt.indigo}</repo.ajdt>
<!-- some default values, can be overwritten by profiles -->
<scala.version>2.9.3-SNAPSHOT</scala.version>
@@ -53,26 +49,12 @@
<profiles>
<profile>
- <!-- this is the default profile, using the stable builds-->
- <id>scala-ide-2.0-scala-2.9</id>
+ <!-- this is the default profile, using the stable Scala build-->
+ <id>scala-2.9</id>
</profile>
<profile>
- <!-- 2.0.x Scala IDE with Scala 2.9 -->
- <id>scala-ide-2.0.x-scala-2.9</id>
- <properties>
- <repo.scala-ide>\${repo.scala-ide.root}/nightly-update-2-0-x-29x</repo.scala-ide>
- </properties>
- </profile>
- <profile>
- <!-- nightly Scala IDE with Scala 2.9 -->
- <id>scala-ide-master-scala-2.9</id>
- <properties>
- <repo.scala-ide>\${repo.scala-ide.root}/nightly-update-master-29x</repo.scala-ide>
- </properties>
- </profile>
- <profile>
- <!-- nightly Scala IDE with Scala trunk -->
- <id>scala-ide-master-scala-trunk</id>
+ <!-- Scala trunk -->
+ <id>scala-trunk</id>
<properties>
<scala.version>2.10.0-SNAPSHOT</scala.version>
<version.suffix>2_10</version.suffix>
@@ -158,13 +140,6 @@
<url>\${repo.eclipse}</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
- <repository>
- <id>ajdt.\${eclipse.codename}</id>
- <name>AJDT for Eclipse p2 repository</name>
- <layout>p2</layout>
- <url>\${repo.ajdt}</url>
- <snapshots><enabled>false</enabled></snapshots>
- </repository>
</repositories>
<build>
@@ -177,27 +152,6 @@
<configuration>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
-
- <!-- Enable JDT weaving -->
- <systemProperties combine.children="append">
- <aj.weaving.verbose>true</aj.weaving.verbose>
- <org.aspectj.weaver.showWeaveInfo>true</org.aspectj.weaver.showWeaveInfo>
- <org.aspectj.osgi.verbose>true</org.aspectj.osgi.verbose>
- </systemProperties>
- <frameworkExtensions>
- <frameworkExtension>
- <groupId>p2.osgi.bundle</groupId>
- <artifactId>org.eclipse.equinox.weaving.hook</artifactId>
- <version>1.0.200.I20120427-0800</version>
- </frameworkExtension>
- </frameworkExtensions>
- <bundleStartLevel>
- <bundle>
- <id>org.eclipse.equinox.weaving.aspectj</id>
- <level>2</level>
- <autoStart>true</autoStart>
- </bundle>
- </bundleStartLevel>
<argLine>\${tycho.test.jvmArgs}</argLine>
</configuration>
</plugin>

0 comments on commit 5f76810

Please sign in to comment.