From e179e77349b03ce851df5c6c0fcb9382b567debf Mon Sep 17 00:00:00 2001 From: Luc Bourlier Date: Tue, 24 Jul 2012 17:41:36 +0200 Subject: [PATCH] Initial commit based on scala-ide-plugin.g8 --- README.md | 29 +- build.sbt | 1 + project/project/plugins.scala | 6 + src/main/g8/$pluginName$.feature/.project | 17 + .../g8/$pluginName$.feature/build.properties | 1 + src/main/g8/$pluginName$.feature/feature.xml | 69 ++++ src/main/g8/$pluginName$.feature/pom.xml | 12 + .../g8/$pluginName$.source.feature/.project | 17 + .../build.properties | 2 + .../$pluginName$.source.feature/feature.xml | 65 ++++ .../g8/$pluginName$.source.feature/pom.xml | 11 + src/main/g8/$pluginName$.tests/.classpath | 8 + src/main/g8/$pluginName$.tests/.project | 18 ++ .../$pluginName$.tests/META-INF/MANIFEST.MF | 15 + .../g8/$pluginName$.tests/build.properties | 5 + src/main/g8/$pluginName$.tests/pom.xml | 25 ++ .../SomeInterestingCodeTest.scala | 17 + .../test-workspace/.gitignore | 1 + .../test-workspace/aProject/.classpath | 7 + .../test-workspace/aProject/.project | 18 ++ .../aProject/src/org/example/ScalaClass.scala | 9 + src/main/g8/$pluginName$.update-site/.project | 17 + src/main/g8/$pluginName$.update-site/pom.xml | 12 + src/main/g8/$pluginName$.update-site/site.xml | 11 + src/main/g8/$pluginName$/.classpath | 8 + src/main/g8/$pluginName$/.project | 26 ++ src/main/g8/$pluginName$/META-INF/MANIFEST.MF | 32 ++ src/main/g8/$pluginName$/build.properties | 6 + src/main/g8/$pluginName$/icons/sample.gif | Bin 0 -> 983 bytes src/main/g8/$pluginName$/plugin.properties | 0 src/main/g8/$pluginName$/plugin.xml | 28 ++ src/main/g8/$pluginName$/pom.xml | 13 + .../$pluginName__packaged$/$className$.scala | 49 +++ .../SomeInterestingCode.scala | 11 + src/main/g8/README.md | 27 ++ src/main/g8/default.properties | 5 + src/main/g8/pom.xml | 301 ++++++++++++++++++ 37 files changed, 896 insertions(+), 3 deletions(-) create mode 100644 build.sbt create mode 100644 project/project/plugins.scala create mode 100644 src/main/g8/$pluginName$.feature/.project create mode 100644 src/main/g8/$pluginName$.feature/build.properties create mode 100644 src/main/g8/$pluginName$.feature/feature.xml create mode 100644 src/main/g8/$pluginName$.feature/pom.xml create mode 100644 src/main/g8/$pluginName$.source.feature/.project create mode 100644 src/main/g8/$pluginName$.source.feature/build.properties create mode 100644 src/main/g8/$pluginName$.source.feature/feature.xml create mode 100644 src/main/g8/$pluginName$.source.feature/pom.xml create mode 100644 src/main/g8/$pluginName$.tests/.classpath create mode 100644 src/main/g8/$pluginName$.tests/.project create mode 100644 src/main/g8/$pluginName$.tests/META-INF/MANIFEST.MF create mode 100644 src/main/g8/$pluginName$.tests/build.properties create mode 100644 src/main/g8/$pluginName$.tests/pom.xml create mode 100644 src/main/g8/$pluginName$.tests/src/$pluginName__packaged$/SomeInterestingCodeTest.scala create mode 100644 src/main/g8/$pluginName$.tests/test-workspace/.gitignore create mode 100644 src/main/g8/$pluginName$.tests/test-workspace/aProject/.classpath create mode 100644 src/main/g8/$pluginName$.tests/test-workspace/aProject/.project create mode 100644 src/main/g8/$pluginName$.tests/test-workspace/aProject/src/org/example/ScalaClass.scala create mode 100644 src/main/g8/$pluginName$.update-site/.project create mode 100644 src/main/g8/$pluginName$.update-site/pom.xml create mode 100644 src/main/g8/$pluginName$.update-site/site.xml create mode 100644 src/main/g8/$pluginName$/.classpath create mode 100644 src/main/g8/$pluginName$/.project create mode 100644 src/main/g8/$pluginName$/META-INF/MANIFEST.MF create mode 100644 src/main/g8/$pluginName$/build.properties create mode 100644 src/main/g8/$pluginName$/icons/sample.gif create mode 100644 src/main/g8/$pluginName$/plugin.properties create mode 100644 src/main/g8/$pluginName$/plugin.xml create mode 100644 src/main/g8/$pluginName$/pom.xml create mode 100644 src/main/g8/$pluginName$/src/$pluginName__packaged$/$className$.scala create mode 100644 src/main/g8/$pluginName$/src/$pluginName__packaged$/SomeInterestingCode.scala create mode 100644 src/main/g8/README.md create mode 100644 src/main/g8/default.properties create mode 100644 src/main/g8/pom.xml diff --git a/README.md b/README.md index 92234a7..3a18da3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,27 @@ -scala-plugin.g8 -=============== +scala-ide-plugin.g8 +=================== -Giger8 template for Eclipse plugins developed in Scala \ No newline at end of file +Giger8 template for Eclipse plugins developed in Scala. + +This template produces 5 Eclipse plugins: + +* the plugin itself +* the `plugin.tests` fragment +* an Eclipse feature +* an Eclipse source feature +* an Eclipse update-site + +The projects can readily be imported inside Eclipse. Additionally, you have maven `pom` files +based on Tycho, enabling command line builds. + +## Note: + +By default, the maven build is performed with the stable version of Scala (2.9). +The available profiles are: + +* `scala-2.9` (default) +* `scala-trunk` + +Run maven like this: + + mvn -P scala-trunk clean install diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..601abd2 --- /dev/null +++ b/build.sbt @@ -0,0 +1 @@ +seq(giter8Settings :_*) \ No newline at end of file diff --git a/project/project/plugins.scala b/project/project/plugins.scala new file mode 100644 index 0000000..431b221 --- /dev/null +++ b/project/project/plugins.scala @@ -0,0 +1,6 @@ +import sbt._ +object PluginDef extends Build { + lazy val root = Project("plugins", file(".")) dependsOn( g8plugin ) + lazy val g8plugin = + ProjectRef(uri("git://github.com/n8han/giter8#0.4.5.1"), "giter8-plugin") +} diff --git a/src/main/g8/$pluginName$.feature/.project b/src/main/g8/$pluginName$.feature/.project new file mode 100644 index 0000000..3858cf9 --- /dev/null +++ b/src/main/g8/$pluginName$.feature/.project @@ -0,0 +1,17 @@ + + + $pluginName$.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/src/main/g8/$pluginName$.feature/build.properties b/src/main/g8/$pluginName$.feature/build.properties new file mode 100644 index 0000000..64f93a9 --- /dev/null +++ b/src/main/g8/$pluginName$.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/src/main/g8/$pluginName$.feature/feature.xml b/src/main/g8/$pluginName$.feature/feature.xml new file mode 100644 index 0000000..2bc7b08 --- /dev/null +++ b/src/main/g8/$pluginName$.feature/feature.xml @@ -0,0 +1,69 @@ + + + + + Template of a Scala IDE plug-in + + + + Copyright (C) 2012 _______TO_UPDATE_______. +All rights reserved. + + + + SCALA LICENSE + +Copyright (C) 2011-2012 Artima, Inc. All rights reserved. + +This software was developed by _______TO_UPDATE_______. + +Permission to use, copy, modify, and distribute this software in source +or binary form for any purpose with or without fee is hereby granted, +provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the EPFL nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + + + + + + + + + + + + diff --git a/src/main/g8/$pluginName$.feature/pom.xml b/src/main/g8/$pluginName$.feature/pom.xml new file mode 100644 index 0000000..057fbec --- /dev/null +++ b/src/main/g8/$pluginName$.feature/pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + + $provider$ + $pluginName$.build + 0.1.0-SNAPSHOT + + $pluginName$.feature + eclipse-feature + diff --git a/src/main/g8/$pluginName$.source.feature/.project b/src/main/g8/$pluginName$.source.feature/.project new file mode 100644 index 0000000..547b381 --- /dev/null +++ b/src/main/g8/$pluginName$.source.feature/.project @@ -0,0 +1,17 @@ + + + $pluginName$.source.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/src/main/g8/$pluginName$.source.feature/build.properties b/src/main/g8/$pluginName$.source.feature/build.properties new file mode 100644 index 0000000..7ae4bc6 --- /dev/null +++ b/src/main/g8/$pluginName$.source.feature/build.properties @@ -0,0 +1,2 @@ +bin.includes = \ +feature.xml diff --git a/src/main/g8/$pluginName$.source.feature/feature.xml b/src/main/g8/$pluginName$.source.feature/feature.xml new file mode 100644 index 0000000..a33605f --- /dev/null +++ b/src/main/g8/$pluginName$.source.feature/feature.xml @@ -0,0 +1,65 @@ + + + + + The source of ScalaTest plugin for Scala IDE to provides a platform to run + tests written using ScalaTest or other test frameworks. + + + + Copyright (C) 2011-2012 ______TO_UPDATE_______. +All rights reserved. + + + +SCALA LICENSE + +Copyright (C) 2011-2012 Artima, Inc. All rights reserved. + +This software was developed by ______TO_UPDATE_______. + +Permission to use, copy, modify, and distribute this software in source +or binary form for any purpose with or without fee is hereby granted, +provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the EPFL nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + + + + + + + + diff --git a/src/main/g8/$pluginName$.source.feature/pom.xml b/src/main/g8/$pluginName$.source.feature/pom.xml new file mode 100644 index 0000000..85ae854 --- /dev/null +++ b/src/main/g8/$pluginName$.source.feature/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + $provider$ + $pluginName$.build + 0.1.0-SNAPSHOT + + $pluginName$.source.feature + eclipse-feature + diff --git a/src/main/g8/$pluginName$.tests/.classpath b/src/main/g8/$pluginName$.tests/.classpath new file mode 100644 index 0000000..7d8e776 --- /dev/null +++ b/src/main/g8/$pluginName$.tests/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/main/g8/$pluginName$.tests/.project b/src/main/g8/$pluginName$.tests/.project new file mode 100644 index 0000000..da53a8a --- /dev/null +++ b/src/main/g8/$pluginName$.tests/.project @@ -0,0 +1,18 @@ + + + $pluginName$.tests + + + + + + org.scala-ide.sdt.core.scalabuilder + + + + + + org.scala-ide.sdt.core.scalanature + org.eclipse.jdt.core.javanature + + diff --git a/src/main/g8/$pluginName$.tests/META-INF/MANIFEST.MF b/src/main/g8/$pluginName$.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000..d8dbe23 --- /dev/null +++ b/src/main/g8/$pluginName$.tests/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: $name$ (Test) +Bundle-SymbolicName: $pluginName$.tests +Bundle-Version: 0.1.0.qualifier +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 +Bundle-ClassPath: . diff --git a/src/main/g8/$pluginName$.tests/build.properties b/src/main/g8/$pluginName$.tests/build.properties new file mode 100644 index 0000000..eb5eee8 --- /dev/null +++ b/src/main/g8/$pluginName$.tests/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = target/classes/ +bin.includes = META-INF/,\ + test-workspace/,\ + . diff --git a/src/main/g8/$pluginName$.tests/pom.xml b/src/main/g8/$pluginName$.tests/pom.xml new file mode 100644 index 0000000..0c620af --- /dev/null +++ b/src/main/g8/$pluginName$.tests/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + $provider$ + $pluginName$.build + 0.1.0-SNAPSHOT + + $pluginName$.tests + eclipse-test-plugin + + + src + + + org.eclipse.tycho + tycho-surefire-plugin + + \${project.artifactId} + $pluginName$.SomeInterestingCodeTest + + + + + + diff --git a/src/main/g8/$pluginName$.tests/src/$pluginName__packaged$/SomeInterestingCodeTest.scala b/src/main/g8/$pluginName$.tests/src/$pluginName__packaged$/SomeInterestingCodeTest.scala new file mode 100644 index 0000000..6723a9c --- /dev/null +++ b/src/main/g8/$pluginName$.tests/src/$pluginName__packaged$/SomeInterestingCodeTest.scala @@ -0,0 +1,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") { + + @Test + def numberOfTypes() { + val compilationUnit= scalaCompilationUnit("org/example/ScalaClass.scala") + + assertEquals("Wrong number of types", 2, SomeInterestingCode.numberOfTypes(compilationUnit)) + + } + +} diff --git a/src/main/g8/$pluginName$.tests/test-workspace/.gitignore b/src/main/g8/$pluginName$.tests/test-workspace/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/src/main/g8/$pluginName$.tests/test-workspace/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/src/main/g8/$pluginName$.tests/test-workspace/aProject/.classpath b/src/main/g8/$pluginName$.tests/test-workspace/aProject/.classpath new file mode 100644 index 0000000..bc01bff --- /dev/null +++ b/src/main/g8/$pluginName$.tests/test-workspace/aProject/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/main/g8/$pluginName$.tests/test-workspace/aProject/.project b/src/main/g8/$pluginName$.tests/test-workspace/aProject/.project new file mode 100644 index 0000000..cbacc23 --- /dev/null +++ b/src/main/g8/$pluginName$.tests/test-workspace/aProject/.project @@ -0,0 +1,18 @@ + + + aProject + + + + + + org.scala-ide.sdt.core.scalabuilder + + + + + + org.scala-ide.sdt.core.scalanature + org.eclipse.jdt.core.javanature + + diff --git a/src/main/g8/$pluginName$.tests/test-workspace/aProject/src/org/example/ScalaClass.scala b/src/main/g8/$pluginName$.tests/test-workspace/aProject/src/org/example/ScalaClass.scala new file mode 100644 index 0000000..7f2b789 --- /dev/null +++ b/src/main/g8/$pluginName$.tests/test-workspace/aProject/src/org/example/ScalaClass.scala @@ -0,0 +1,9 @@ +package org.example + +class ScalaClass { + +} + +object ScalaClass { + +} \ No newline at end of file diff --git a/src/main/g8/$pluginName$.update-site/.project b/src/main/g8/$pluginName$.update-site/.project new file mode 100644 index 0000000..f826407 --- /dev/null +++ b/src/main/g8/$pluginName$.update-site/.project @@ -0,0 +1,17 @@ + + + $pluginName$.update-site + + + + + + org.eclipse.pde.UpdateSiteBuilder + + + + + + org.eclipse.pde.UpdateSiteNature + + diff --git a/src/main/g8/$pluginName$.update-site/pom.xml b/src/main/g8/$pluginName$.update-site/pom.xml new file mode 100644 index 0000000..fce154f --- /dev/null +++ b/src/main/g8/$pluginName$.update-site/pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + + $provider$ + $pluginName$.build + 0.1.0-SNAPSHOT + + $pluginName$.update-site + eclipse-update-site + diff --git a/src/main/g8/$pluginName$.update-site/site.xml b/src/main/g8/$pluginName$.update-site/site.xml new file mode 100644 index 0000000..aeb74a8 --- /dev/null +++ b/src/main/g8/$pluginName$.update-site/site.xml @@ -0,0 +1,11 @@ + + + + + + + + + + --> + diff --git a/src/main/g8/$pluginName$/.classpath b/src/main/g8/$pluginName$/.classpath new file mode 100644 index 0000000..35e6162 --- /dev/null +++ b/src/main/g8/$pluginName$/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/main/g8/$pluginName$/.project b/src/main/g8/$pluginName$/.project new file mode 100644 index 0000000..b5f14ee --- /dev/null +++ b/src/main/g8/$pluginName$/.project @@ -0,0 +1,26 @@ + + + $pluginName$ + + + + + + org.scala-ide.sdt.core.scalabuilder + + + + org.eclipse.pde.ManifestBuilder + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.PluginNature + org.scala-ide.sdt.core.scalanature + org.eclipse.jdt.core.javanature + + diff --git a/src/main/g8/$pluginName$/META-INF/MANIFEST.MF b/src/main/g8/$pluginName$/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5675c15 --- /dev/null +++ b/src/main/g8/$pluginName$/META-INF/MANIFEST.MF @@ -0,0 +1,32 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: $name$ +Bundle-SymbolicName: $pluginName$;singleton:=true +Bundle-Version: 0.1.0.qualifier +Bundle-Vendor: $providerName$ +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 +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ClassPath: . diff --git a/src/main/g8/$pluginName$/build.properties b/src/main/g8/$pluginName$/build.properties new file mode 100644 index 0000000..12a9ae0 --- /dev/null +++ b/src/main/g8/$pluginName$/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = target/classes/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties diff --git a/src/main/g8/$pluginName$/icons/sample.gif b/src/main/g8/$pluginName$/icons/sample.gif new file mode 100644 index 0000000000000000000000000000000000000000..34fb3c9d8cb7d489681b7f7aee4bdcd7eaf53610 GIT binary patch literal 983 zcmZ?wbhEHb6krfw_|CxKYUg-n!?izO{@9*?jxd%4aX0yzy`dymabz zw#(eg=y~&N&n)dZv2xzduG}5lraiApo3(c4*{Ylg5#|$JO_EEZ<^|a2`Z*=9ns7DV zy=TR&gYw*7f%auV?ip3tvjRPmcdoho{K?x$_vR?C#t5&<;~V}S*>OMCr>h}%%bLZ9 zmo3`hYEwTICo-TTCZwgTsC&VjZRgJ1eE#fBa^%9R zmmfWS@;bnyJ27HWY}kxYzv(Hl>yu;FCPlAEh+34Muq-8Rb6C)<8qA3{r2e5 z`$vyngh#H=FWlqqvnapfc5%(!sQ4v?r7J61-&eJNEN^;KTK}T7{#i-gJh%G*9vcYdwv_*~xdw!Gz4Va?T!sXyyF@8?w<>X`X=#j%uHV4GRvj@+tE@ zQ%F!a)GKcn^~8abN>4la1UNXVL;{ZWi)lEwyeatDu%Lr6;aASiLrXXW zQm# + + + + + + + + + + + + + diff --git a/src/main/g8/$pluginName$/pom.xml b/src/main/g8/$pluginName$/pom.xml new file mode 100644 index 0000000..896966d --- /dev/null +++ b/src/main/g8/$pluginName$/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + + $provider$ + $pluginName$.build + 0.1.0-SNAPSHOT + + $pluginName$ + eclipse-plugin + + diff --git a/src/main/g8/$pluginName$/src/$pluginName__packaged$/$className$.scala b/src/main/g8/$pluginName$/src/$pluginName__packaged$/$className$.scala new file mode 100644 index 0000000..78d8227 --- /dev/null +++ b/src/main/g8/$pluginName$/src/$pluginName__packaged$/$className$.scala @@ -0,0 +1,49 @@ +package $pluginName$ + +import org.eclipse.ui.IWorkbenchWindowActionDelegate +import org.eclipse.jface.action.IAction +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 + +class $className$ extends IWorkbenchWindowActionDelegate { + + private var window: IWorkbenchWindow = _ + + def dispose() { + } + + def init(w: IWorkbenchWindow) { + window = w + } + + 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")) + } + + def getProjectName(file: IFile): Option[String] = { + ScalaPlugin.plugin.asScalaProject(file.getProject).map(_.underlying.getName) + } + +} \ No newline at end of file diff --git a/src/main/g8/$pluginName$/src/$pluginName__packaged$/SomeInterestingCode.scala b/src/main/g8/$pluginName$/src/$pluginName__packaged$/SomeInterestingCode.scala new file mode 100644 index 0000000..8eeabb4 --- /dev/null +++ b/src/main/g8/$pluginName$/src/$pluginName__packaged$/SomeInterestingCode.scala @@ -0,0 +1,11 @@ +package $pluginName$ + +import scala.tools.eclipse.javaelements.ScalaCompilationUnit + +object SomeInterestingCode { + + def numberOfTypes(scalaCompilationUnit: ScalaCompilationUnit): Int = { + scalaCompilationUnit.getCompilationUnit.getAllTypes.length + } + +} \ No newline at end of file diff --git a/src/main/g8/README.md b/src/main/g8/README.md new file mode 100644 index 0000000..3a18da3 --- /dev/null +++ b/src/main/g8/README.md @@ -0,0 +1,27 @@ +scala-ide-plugin.g8 +=================== + +Giger8 template for Eclipse plugins developed in Scala. + +This template produces 5 Eclipse plugins: + +* the plugin itself +* the `plugin.tests` fragment +* an Eclipse feature +* an Eclipse source feature +* an Eclipse update-site + +The projects can readily be imported inside Eclipse. Additionally, you have maven `pom` files +based on Tycho, enabling command line builds. + +## Note: + +By default, the maven build is performed with the stable version of Scala (2.9). +The available profiles are: + +* `scala-2.9` (default) +* `scala-trunk` + +Run maven like this: + + mvn -P scala-trunk clean install diff --git a/src/main/g8/default.properties b/src/main/g8/default.properties new file mode 100644 index 0000000..de521b6 --- /dev/null +++ b/src/main/g8/default.properties @@ -0,0 +1,5 @@ +name=Scala IDE Sample plugin +pluginName=org.example.plugin +provider=org.example +providerName=Scala IDE +className=SampleAction diff --git a/src/main/g8/pom.xml b/src/main/g8/pom.xml new file mode 100644 index 0000000..2a03dbd --- /dev/null +++ b/src/main/g8/pom.xml @@ -0,0 +1,301 @@ + + + 4.0.0 + + 3.0 + + $provider$ + $pluginName$.build + 0.1.0-SNAPSHOT + $name$ + pom + + + $pluginName$ + $pluginName$.tests + $pluginName$.feature + $pluginName$.source.feature + $pluginName$.update-site + + + + UTF-8 + + http://download.eclipse.org/releases/indigo/ + http://download.eclipse.org/releases/juno/ + http://download.eclipse.org/tools/ajdt/37/dev/update + http://download.scala-ide.org + + + 0.15.0 + 3.0.2 + + + + + -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dosgi.classloader.lock=classname + -Xmx800m -XX:MaxPermSize=256m -Dsdtcore.headless \${tycho.test.weaving} \${tycho.test.OSspecific} + + + indigo + \${repo.eclipse.indigo} + \${repo.ajdt.indigo} + + + 2.9.3-SNAPSHOT + 2_09 + 2.9 + local + \${repo.scala-ide.root}/releases-29/stable/tycho-site + 4.10 + + + + + + scala-ide-2.0-scala-2.9 + + + + scala-ide-2.0.x-scala-2.9 + + \${repo.scala-ide.root}/nightly-update-2-0-x-29x + + + + + scala-ide-master-scala-2.9 + + \${repo.scala-ide.root}/nightly-update-master-29x + + + + + scala-ide-master-scala-trunk + + 2.10.0-SNAPSHOT + 2_10 + 2.10 + \${repo.scala-ide.root}/nightly-update-master-trunk + + + + + + macOs + + + mac + + + + -Dosgi.ws=cocoa -XstartOnFirstThread + + + + + + org.eclipse.tycho + tycho-surefire-plugin + + + + org.eclipse.jdt.launching.macosx + eclipse-plugin + + + + + + + + + + + + + scm:git://github.com/skyluc/plugin.git + https://github.com/skyluc/plugin + + + + + + junit + junit + \${junit.version} + + + + + + + sonatype.release + Sonatype maven release repository + https://oss.sonatype.org/content/repositories/releases/ + false + + + sonatype.snapshot + Sonatype maven snapshot repository + https://oss.sonatype.org/content/repositories/snapshots + + daily + + + + scala-ide + Scala IDE p2 repository + p2 + \${repo.scala-ide} + false + + + eclipse.\${eclipse.codename} + Eclipse p2 repository + p2 + \${repo.eclipse} + false + + + ajdt.\${eclipse.codename} + AJDT for Eclipse p2 repository + p2 + \${repo.ajdt} + false + + + + + + + + org.eclipse.tycho + tycho-surefire-plugin + \${tycho.version} + + false + false + + + + true + true + true + + + + p2.osgi.bundle + org.eclipse.equinox.weaving.hook + 1.0.200.I20120427-0800 + + + + + org.eclipse.equinox.weaving.aspectj + 2 + true + + + \${tycho.test.jvmArgs} + + + + + + + org.eclipse.tycho + tycho-maven-plugin + \${tycho.version} + true + + + org.eclipse.tycho + tycho-compiler-plugin + \${tycho.version} + + + **/*.scala + + + + + + net.alchim31.maven + scala-maven-plugin + \${scala.plugin.version} + + + process-resources + + compile + + + + + + -Xms512m + -Xmx1024m + + + + + org.eclipse.tycho + tycho-source-plugin + \${tycho.version} + + + attach-source + + plugin-source + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + attach-sources + + jar + + + + + + + org.eclipse.tycho + tycho-packaging-plugin + \${tycho.version} + + '\${version.tag}-\${version.suffix}-'yyyyMMddHHmm'-\${buildNumber}' + true + + + + + org.codehaus.mojo + buildnumber-maven-plugin + 1.1 + + + validate + + create + + + + + false + false + 7 + + + + + +