Permalink
Browse files

Last conflict resolved between ideax and maia platform and run the te…

…sts on both before building a jar.
  • Loading branch information...
1 parent d774018 commit feb1e60545084e1676d049086694fd1e05fe3071 @netzpirat committed Feb 3, 2011
View
5 DEVELOPMENT.md
@@ -21,8 +21,11 @@ and [IntelliJ IDEA 9](http://devnet.jetbrains.net/docs/DOC-1228) to verify the b
* Fork CoffeeBrew and check your personal repository out.
* Check out IntelliJ IDEA Community from `git://git.jetbrains.org/idea/community.git`.
* Go into that directory and build IDEA by just calling `ant` on the command line.
+* Make a copy of that freshly cloned git repository for the maia branch.
+* Go into that directory and checkout the maia branch.
+* Build IDEA for maia by just calling `ant` on the command line.
* Go to the CoffeeBrew directory, copy `build.properties.sample` to `build.properties` and modify the path to the
-IntelliJ IDEA Community source code.
+source code and installed application for both ideax and maia.
* Open the CoffeeBrew project in your downloaded IDEA and go to `File > Project Settings`
* Under SDK add a new IntelliJ IDEA Plugin SDK by pointing it to the downloaded IDEA version.
* Add the freshly compiled `<idea>/out/dist.all.ce/lib/idea.jar` to the classpath.
View
15 build.properties.sample
@@ -1,3 +1,16 @@
+#
# Add your environment settings and copy this file to build.properties
-idea.home=/Users/michi/Repositories/idea
+#
+
+# The directory with the master branch of git://git.jetbrains.org/idea/community.git
+ideax.source=/Users/michi/Repositories/jetbrains/idea-master
+
+# The directory where IntelliJ IDEA 10 CE is installed
+ideax.app=/Applications/IntelliJ IDEA 10 CE.app/lib/
+
+# The directory with the maia branch of git://git.jetbrains.org/idea/community.git
+maia.source=/Users/michi/Repositories/jetbrains/idea-maia
+
+# The directory where IntelliJ IDEA 9.0.3 CE is installed
+maia.app=/Applications/IntelliJ IDEA 9.0.3 CE.app/lib/
View
156 build.xml
@@ -13,26 +13,44 @@
<!-- Reference the IDEA classpath from the local IDE installation -->
- <path id="idea.classpath">
- <fileset dir="${idea.home}">
+ <path id="ideax.classpath">
+ <fileset dir="${ideax.source}">
<include name="lib/*.jar"/>
<include name="redist/*.jar"/>
</fileset>
- <fileset dir="/Applications/IntelliJ IDEA 10 CE.app/lib/">
+ <fileset dir="${ideax.app}">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <path id="maia.classpath">
+ <fileset dir="${maia.source}">
+ <include name="lib/*.jar"/>
+ <include name="redist/*.jar"/>
+ </fileset>
+ <fileset dir="${maia.app}">
<include name="*.jar"/>
</fileset>
</path>
<!-- Define the java compiler task -->
- <taskdef name="javac2" classname="com.intellij.ant.Javac2">
- <classpath refid="idea.classpath"/>
+ <taskdef name="javacIdeax" classname="com.intellij.ant.Javac2">
+ <classpath refid="ideax.classpath"/>
+ </taskdef>
+
+ <taskdef name="javacMaia" classname="com.intellij.ant.Javac2">
+ <classpath refid="maia.classpath"/>
</taskdef>
<!-- Define the jflex compiler task -->
- <taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
- <classpath location="${idea.home}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
+ <taskdef name="jflexIdeax" classname="JFlex.anttask.JFlexTask">
+ <classpath location="${ideax.source}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
+ </taskdef>
+
+ <taskdef name="jflexMaia" classname="JFlex.anttask.JFlexTask">
+ <classpath location="${maia.source}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
</taskdef>
<!-- Clean up generated files -->
@@ -44,18 +62,28 @@
<!-- Create target directories -->
<target name="init" depends="clean">
- <mkdir dir="target/classes/META-INF"/>
- <mkdir dir="target/junit"/>
- <mkdir dir="target/test-classes"/>
- <mkdir dir="target/test-reports"/>
+ <mkdir dir="target/ideax-classes/META-INF"/>
+ <mkdir dir="target/junit-ideax"/>
+ <mkdir dir="target/test-ideax-classes"/>
+ <mkdir dir="target/test-ideax-reports"/>
+ <mkdir dir="target/maia-classes/META-INF"/>
+ <mkdir dir="target/junit-maia"/>
+ <mkdir dir="target/test-maia-classes"/>
+ <mkdir dir="target/test-maia-reports"/>
<mkdir dir="target/coffee-script"/>
<mkdir dir="target/jar"/>
</target>
<!-- Copy compilation resources -->
- <target name="resources" depends="init">
- <copy todir="target/classes">
+ <target name="resources-ideax" depends="init">
+ <copy todir="target/ideax-classes">
+ <fileset dir="resources" excludes="coffee-script/**"/>
+ </copy>
+ </target>
+
+ <target name="resources-maia" depends="init">
+ <copy todir="target/maia-classes">
<fileset dir="resources" excludes="coffee-script/**"/>
</copy>
</target>
@@ -76,51 +104,82 @@
<!-- Generate the lexer class -->
- <target name="generate-lexer" description="Generate the CoffeeScriptLexer class from the flex definition">
- <jflex skeleton="${idea.home}/tools/lexer/idea-flex.skeleton" nobak="true"
- file="src/org/coffeebrew/lang/lexer/coffee-script.flex"
- destdir="src"
- charat="true"/>
+ <target name="generate-ideax-lexer">
+ <jflexIdeax skeleton="${ideax.source}/tools/lexer/idea-flex.skeleton" nobak="true"
+ file="src/org/coffeebrew/lang/lexer/coffee-script.flex"
+ destdir="src"
+ charat="true"/>
+ </target>
+
+ <target name="generate-maia-lexer">
+ <jflexMaia skeleton="${maia.source}/tools/lexer/idea-flex.skeleton" nobak="true"
+ file="src/org/coffeebrew/lang/lexer/coffee-script.flex"
+ destdir="src"
+ charat="true"/>
</target>
<!-- Compile the plugin -->
- <target name="compile" depends="resources, generate-lexer">
- <javac2 srcdir="src" destdir="target/classes" source="1.5" target="1.5" includeantruntime="yes">
- <classpath refid="idea.classpath"/>
- </javac2>
- <javac2 srcdir="test" destdir="target/test-classes" source="1.5" target="1.5" includeantruntime="yes">
- <classpath refid="idea.classpath"/>
- <classpath location="target/classes"/>
- </javac2>
+ <target name="compile-ideax" depends="resources-ideax, generate-ideax-lexer">
+ <javacIdeax srcdir="src" destdir="target/ideax-classes" source="1.5" target="1.5" includeantruntime="yes">
+ <classpath refid="ideax.classpath"/>
+ </javacIdeax>
+ <javacIdeax srcdir="test" destdir="target/test-ideax-classes" source="1.5" target="1.5" includeantruntime="yes">
+ <classpath refid="ideax.classpath"/>
+ <classpath location="target/ideax-classes"/>
+ </javacIdeax>
+ </target>
+
+ <target name="compile-maia" depends="resources-maia, generate-maia-lexer">
+ <javacMaia srcdir="src" destdir="target/maia-classes" source="1.5" target="1.5" includeantruntime="yes">
+ <classpath refid="maia.classpath"/>
+ </javacMaia>
+ <javacMaia srcdir="test" destdir="target/test-maia-classes" source="1.5" target="1.5" includeantruntime="yes">
+ <classpath refid="maia.classpath"/>
+ <classpath location="target/maia-classes"/>
+ </javacMaia>
</target>
<!-- Test the plugin -->
- <target name="test" depends="compile">
+ <target name="test-ideax" depends="compile-ideax">
+ <junit failureproperty="unit-test.fail" forkmode="once" fork="yes" includeantruntime="yes"
+ tempdir="${basedir}/target/junit-ideax" printsummary="yes" showoutput="yes">
+ <classpath location="${basedir}/target/ideax-classes"/>
+ <classpath location="${basedir}/target/test-ideax-classes"/>
+ <classpath refid="ideax.classpath"/>
+ <formatter type="xml"/>
+ <batchtest todir="${basedir}/target/test-ideax-reports" fork="yes">
+ <fileset dir="${basedir}/target/test-ideax-classes" includes="**/*Test.class"/>
+ </batchtest>
+ </junit>
+ <fail if="unit-test.fail" message="Unit test failed. See target/test-ideax-reports for more information."/>
+ </target>
+
+ <target name="test-maia" depends="compile-maia">
<junit failureproperty="unit-test.fail" forkmode="once" fork="yes" includeantruntime="yes"
- tempdir="${basedir}/target/junit" printsummary="yes" showoutput="yes">
- <classpath location="${basedir}/target/classes"/>
- <classpath location="${basedir}/target/test-classes"/>
- <classpath refid="idea.classpath"/>
+ tempdir="${basedir}/target/junit-maia" printsummary="yes" showoutput="yes">
+ <classpath location="${basedir}/target/maia-classes"/>
+ <classpath location="${basedir}/target/test-maia-classes"/>
+ <classpath refid="maia.classpath"/>
<formatter type="xml"/>
- <batchtest todir="${basedir}/target/test-reports" fork="yes">
- <fileset dir="${basedir}/target/test-classes" includes="**/*Test.class"/>
+ <batchtest todir="${basedir}/target/test-maia-reports" fork="yes">
+ <fileset dir="${basedir}/target/test-maia-classes" includes="**/*Test.class"/>
</batchtest>
</junit>
- <fail if="unit-test.fail" message="Unit test failed. See target/test-reports for more information."/>
+ <fail if="unit-test.fail" message="Unit test failed. See target/test-maia-reports for more information."/>
</target>
<!-- Build the jar -->
- <target name="jar" depends="test, compile" description="Build the plugin jar">
- <copy file="META-INF/plugin.xml" todir="target/classes/META-INF">
+ <target name="jar" depends="test-maia, test-ideax" description="Build the plugin jar">
+ <copy file="META-INF/plugin.xml" todir="target/ideax-classes/META-INF">
<filterset>
<filter token="version" value="${version}"/>
</filterset>
</copy>
<jar destfile="target/jar/coffee-brew-${version}.jar" compress="true">
- <fileset dir="target/classes"/>
+ <fileset dir="target/ideax-classes"/>
</jar>
</target>
@@ -168,48 +227,49 @@
<target name="release" depends="nothing-to-commit" description="Release a new version">
<echo>The current version is: ${version}</echo>
- <input message="Enter the new version: " addproperty="release" />
+ <input message="Enter the new version: " addproperty="release"/>
<antcall target="jar">
<param name="version" value="${release}"/>
</antcall>
- <input message="Going to release version ${release}. Are you sure? " addproperty="do.release" validargs="y,n" />
+ <input message="Going to release version ${release}. Are you sure? " addproperty="do.release" validargs="y,n"/>
<condition property="do.abort">
- <equals arg1="n" arg2="${do.release}"/>
+ <equals arg1="n" arg2="${do.release}"/>
</condition>
<fail if="do.abort">Release aborted by user.</fail>
<echo file="VERSION">${release}</echo>
<exec executable="git">
- <arg line="commit VERSION -m 'New release v${release}'" />
+ <arg line="commit VERSION -m 'New release v${release}'"/>
</exec>
<exec executable="git">
- <arg line="tag v${release}" />
+ <arg line="tag v${release}"/>
</exec>
<exec executable="git">
- <arg line="push --tags origin master" />
+ <arg line="push --tags origin master"/>
</exec>
- <echo>Release is done. Please upload target/jar/coffee-brew-${release}.jar to JetBrains Plugin Repository now.</echo>
+ <echo>Release is done. Please upload target/jar/coffee-brew-${release}.jar to JetBrains Plugin Repository now.
+ </echo>
<exec executable="open">
- <arg value="http://plugins.intellij.net/plugin/?&amp;id=5920" />
+ <arg value="http://plugins.intellij.net/plugin/?&amp;id=5920"/>
</exec>
<echo>---------------------- CHANGELOG ------------------------</echo>
<exec executable="git">
- <arg line="shortlog v${version}..v${release}" />
+ <arg line="shortlog v${version}..v${release}"/>
</exec>
<echo>---------------------------------------------------------</echo>
</target>
<target name="nothing-to-commit">
<exec executable="git" outputproperty="result">
- <arg value="status" />
+ <arg value="status"/>
</exec>
<condition property="do.abort">
<not>
- <contains substring="nothing to commit" string="${result}" />
+ <contains substring="nothing to commit" string="${result}"/>
</not>
</condition>
<fail if="do.abort">Uncommited changes. Please commit all changes before release a new version.</fail>
View
29 src/org/coffeebrew/file/CoffeeScriptFileElementType.java
@@ -1,29 +0,0 @@
-package org.coffeebrew.file;
-
-import com.intellij.lang.*;
-import com.intellij.openapi.project.Project;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.tree.IFileElementType;
-
-/**
- * @author Michael Kessler
- * @since 0.1.5
- */
-public class CoffeeScriptFileElementType extends IFileElementType {
-
- public CoffeeScriptFileElementType() {
- super("CoffeeScript File", CoffeeScriptFileType.COFFEE_SCRIPT_LANGUAGE);
- }
-
- public ASTNode parseContents(ASTNode chameleon) {
- final PsiElement psi = chameleon.getPsi();
- assert psi != null : "Bad chameleon: " + chameleon;
- final Project project = psi.getProject();
- final PsiBuilderFactory factory = PsiBuilderFactory.getInstance();
-
- final PsiBuilder builder = factory.createBuilder(project, chameleon);
-
- final PsiParser parser = LanguageParserDefinitions.INSTANCE.forLanguage(getLanguage()).createParser(project);
- return parser.parse(this, builder);
- }
-}
View
5 src/org/coffeebrew/lang/parser/CoffeeScriptParserDefinition.java
@@ -10,7 +10,8 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.tree.IFileElementType;
import com.intellij.psi.tree.TokenSet;
-import org.coffeebrew.file.CoffeeScriptFileElementType;
+
+import org.coffeebrew.file.CoffeeScriptFileType;
import org.coffeebrew.lang.lexer.CoffeeScriptFlexLexer;
import org.coffeebrew.lang.lexer.CoffeeScriptTokenSets;
import org.coffeebrew.lang.psi.CoffeeScriptFile;
@@ -19,7 +20,7 @@
public class CoffeeScriptParserDefinition implements ParserDefinition {
- private static final IFileElementType FILE_ELEMENT_TYPE = new CoffeeScriptFileElementType();
+ private static final IFileElementType FILE_ELEMENT_TYPE = new IFileElementType(CoffeeScriptFileType.COFFEE_SCRIPT_LANGUAGE);
@NotNull
public Lexer createLexer(Project project) {

0 comments on commit feb1e60

Please sign in to comment.