From: <ko...@us...> - 2010-03-10 00:10:29
|
Revision: 17445 http://jedit.svn.sourceforge.net/jedit/?rev=17445&view=rev Author: kog13 Date: 2010-03-10 00:10:20 +0000 (Wed, 10 Mar 2010) Log Message: ----------- Tagging for 1.1 release Added Paths: ----------- plugins/ProjectBuilder/tags/1.1/ plugins/ProjectBuilder/tags/1.1/build.xml plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props plugins/ProjectBuilder/tags/1.1/conf/services.xml plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectToolbar.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/actions/PVMenu.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/BuildSettingDialog.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/Entry.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/RunSettingDialog.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/ShellRunner.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/options/BuildRunOptionsPane.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/options/CommandList.java Removed Paths: ------------- plugins/ProjectBuilder/tags/1.1/build.properties plugins/ProjectBuilder/tags/1.1/build.xml plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props plugins/ProjectBuilder/tags/1.1/conf/services.xml plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectToolbar.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/actions/PVMenu.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/AddBuildSettingDialog.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/AddRunSettingDialog.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/Entry.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/command/ShellRunner.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/options/BuildRunOptionsPane.java plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/options/CommandList.java Deleted: plugins/ProjectBuilder/tags/1.1/build.properties =================================================================== --- plugins/ProjectBuilder/trunk/build.properties 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/build.properties 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,4 +0,0 @@ -jedit.install.dir=/usr/share/jEdit -build.support=/usr/share/jEdit/build-support -install.dir=/home/damien/.jedit/jars -jedit.plugins.dir=/home/damien/.jedit/jars Deleted: plugins/ProjectBuilder/tags/1.1/build.xml =================================================================== --- plugins/ProjectBuilder/trunk/build.xml 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/build.xml 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,83 +0,0 @@ -<?xml version="1.0" ?> -<project name="ProjectBuilder" default="build" basedir="."> - <property file="build.properties" /> - <property file="../build.properties" /> - <property name="compiler.source" value="1.6" /> - <property name="compiler.target" value="1.6" /> - - <!-- for groovyc --> - <property name="groovy.jar.name" value="groovy-all-1.5.6.jar" /> - - <!-- project source properties --> - <property name="src.dir" value="source/main/src" /> - <property name="src.resources.dir" value="source/main/resources"/> - - <!-- jedit properties --> - <property name="docs-proc.target" value="none" /> - <property name="junit.jar" value="../junit/junit.jar" /> - - <!-- import jEdit common build file --> - <import file="${build.support}/plugin-build.xml" /> - - <!-- Extra files to package into the jar --> - <selector id="extraFiles"> - <and> - <or> - <filename name="**/*.html" /> - </or> - </and> - </selector> - - <path id="project.class.path"> - <pathelement path="${jedit.install.dir}/jedit.jar" /> - <pathelement path="${jedit.plugins.dir}/${groovy.jar.name}" /> - <pathelement path="${jedit.plugins.dir}/ant.jar" /> - <pathelement path="${jedit.plugins.dir}/ScriptEnginePlugin.jar" /> - <pathelement path="${jedit.plugins.dir}/ProjectViewer.jar" /> - <pathelement path="${jedit.plugins.dir}/CommonControls.jar" /> - <pathelement path="${jedit.plugins.dir}/Console.jar" /> - <pathelement path="${jedit.plugins.dir}/AntFarm.jar" /> - <pathelement path="${jedit.plugins.dir}/ErrorList.jar" /> - <pathelement path="${jedit.plugins.dir}/AntFarm.jar" /> - <pathelement path="${jedit.plugins.dir}/CommonControls.jar" /> - <pathelement path="${jedit.plugins.dir}/Console.jar" /> - <pathelement path="${jedit.plugins.dir}/ErrorList.jar" /> - <pathelement path="${jedit.plugins.dir}/GroovyScriptEnginePlugin.jar" /> - <pathelement path="${jedit.plugins.dir}/kappalayout.jar" /> - <pathelement path="${jedit.plugins.dir}/ProjectViewer.jar" /> - </path> - - <target name="build.prepare"> - <!-- Copy over the Project Templates --> - <mkdir dir="${build.classes}" /> - <!-- Copy resources over to classes dir - ignore templates, those will be - zipped up --> - <copy todir="${build.classes}"> - <fileset dir="${src.resources.dir}"> - <filename name="**/*" /> - <exclude name="templates/"/> - </fileset> - <fileset dir="conf"> - <filename name="**/*" /> - </fileset> - </copy> - - <!-- Zip up templates --> - <zip destfile="${build.classes}/templates.zip" basedir="${src.resources.dir}/templates" includes="**/*" /> - </target> - - <!-- Overridden to use joint Groovy compilation --> - <target name="compile"> - <!-- Compile the ProjectBuilder groovy classes --> - <echo>${build.classes}</echo> - <groovyc srcdir="${src.dir}" destdir="${build.classes}" verbose="${compiler.verbose}" listfiles="${compiler.listfiles}"> - <classpath refid="project.class.path" /> - <javac debuglevel="${compiler.debuglevel}" deprecation="${compiler.deprecation}" fork="${compiler.fork}" listfiles="${compiler.listfiles}" nowarn="${compiler.nowarn}" optimize="${compiler.optimize}" source="${compiler.source}" target="${compiler.target}" verbose="${compiler.verbose}" debug="${compiler.debug}"></javac> - </groovyc> - </target> - - <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${jedit.plugins.dir}/${groovy.jar.name}" /> -</project> -<!-- - ::mode=xml:noTabs=true:tabSize=3:folding=indent:indentSize=3:: ---> \ No newline at end of file Copied: plugins/ProjectBuilder/tags/1.1/build.xml (from rev 17444, plugins/ProjectBuilder/trunk/build.xml) =================================================================== --- plugins/ProjectBuilder/tags/1.1/build.xml (rev 0) +++ plugins/ProjectBuilder/tags/1.1/build.xml 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1,85 @@ +<?xml version="1.0" ?> +<project name="ProjectBuilder" default="build" basedir="."> + <property file="build.properties" /> + <property file="../build.properties" /> + <property file="/home/damien/.jedit/build.properties" /> + <property name="compiler.source" value="1.6" /> + <property name="compiler.target" value="1.6" /> + + <!-- for groovyc --> + <property name="groovy.jar.name" value="groovy-all-1.5.6.jar" /> + + <!-- project source properties --> + <property name="src.dir" value="source/main/src" /> + <property name="src.resources.dir" value="source/main/resources"/> + + <!-- jedit properties --> + <!-- <property name="docs-proc.target" value="none" /> --> + <property name="junit.jar" value="../junit/junit.jar" /> + + <!-- import jEdit common build file --> + <import file="${build.support}/plugin-build.xml" /> + + <!-- Extra files to package into the jar --> + <selector id="extraFiles"> + <and> + <or> + <filename name="**/*.html" /> + <filename name="**/*.png" /> + </or> + </and> + </selector> + + <path id="project.class.path"> + <pathelement path="${jedit.install.dir}/jedit.jar" /> + <pathelement path="${jedit.plugins.dir}/${groovy.jar.name}" /> + <pathelement path="${jedit.plugins.dir}/ant.jar" /> + <pathelement path="${jedit.plugins.dir}/ScriptEnginePlugin.jar" /> + <pathelement path="${jedit.plugins.dir}/ProjectViewer.jar" /> + <pathelement path="${jedit.plugins.dir}/CommonControls.jar" /> + <pathelement path="${jedit.plugins.dir}/Console.jar" /> + <pathelement path="${jedit.plugins.dir}/AntFarm.jar" /> + <pathelement path="${jedit.plugins.dir}/ErrorList.jar" /> + <pathelement path="${jedit.plugins.dir}/AntFarm.jar" /> + <pathelement path="${jedit.plugins.dir}/CommonControls.jar" /> + <pathelement path="${jedit.plugins.dir}/Console.jar" /> + <pathelement path="${jedit.plugins.dir}/ErrorList.jar" /> + <pathelement path="${jedit.plugins.dir}/GroovyScriptEnginePlugin.jar" /> + <pathelement path="${jedit.plugins.dir}/kappalayout.jar" /> + <pathelement path="${jedit.plugins.dir}/ProjectViewer.jar" /> + </path> + + <target name="build.prepare"> + <!-- Copy over the Project Templates --> + <mkdir dir="${build.classes}" /> + <!-- Copy resources over to classes dir - ignore templates, those will be + zipped up --> + <copy todir="${build.classes}"> + <fileset dir="${src.resources.dir}"> + <filename name="**/*" /> + <exclude name="templates/"/> + </fileset> + <fileset dir="conf"> + <filename name="**/*" /> + </fileset> + </copy> + + <!-- Zip up templates --> + <zip destfile="${build.classes}/templates.zip" basedir="${src.resources.dir}/templates" includes="**/*" /> + </target> + + <!-- Overridden to use joint Groovy compilation --> + <target name="compile"> + <!-- Compile the ProjectBuilder groovy classes --> + <echo>${build.classes}</echo> + <groovyc srcdir="${src.dir}" destdir="${build.classes}" verbose="${compiler.verbose}" listfiles="${compiler.listfiles}"> + <classpath refid="project.class.path" /> + <javac debuglevel="${compiler.debuglevel}" deprecation="${compiler.deprecation}" fork="${compiler.fork}" listfiles="${compiler.listfiles}" nowarn="${compiler.nowarn}" optimize="${compiler.optimize}" source="${compiler.source}" target="${compiler.target}" verbose="${compiler.verbose}" debug="${compiler.debug}"></javac> + </groovyc> + </target> + + <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${jedit.plugins.dir}/${groovy.jar.name}" /> +</project> +<!-- + ::mode=xml:noTabs=true:tabSize=3:folding=indent:indentSize=3:: +--> \ No newline at end of file Deleted: plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props =================================================================== --- plugins/ProjectBuilder/trunk/conf/ProjectBuilder.props 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,72 +0,0 @@ -# Basic Plugin Information {{{ -plugin.projectbuilder.ProjectBuilderPlugin.activate=startup -plugin.projectbuilder.ProjectBuilderPlugin.author=Eric Berry, Damien Radtke -plugin.projectbuilder.ProjectBuilderPlugin.description=Provides templates to create new projects of different types. -plugin.projectbuilder.ProjectBuilderPlugin.docs=docs/ProjectBuilder.html -plugin.projectbuilder.ProjectBuilderPlugin.longdescription=description.html -plugin.projectbuilder.ProjectBuilderPlugin.name=Project Builder -plugin.projectbuilder.ProjectBuilderPlugin.usePluginHome=true -plugin.projectbuilder.ProjectBuilderPlugin.version=1.0 -# }}} Basic Plugin Information - -# Dependencies {{{ -plugin.projectbuilder.ProjectBuilderPlugin.depend.0=jedit 04.03.18.00 -plugin.projectbuilder.ProjectBuilderPlugin.depend.1=jdk 1.6 -plugin.projectbuilder.ProjectBuilderPlugin.depend.2=plugin com.townsfolkdesigns.jedit.plugins.scripting.GroovyScriptEnginePlugin 1.0.0 -plugin.projectbuilder.ProjectBuilderPlugin.depend.3=plugin projectviewer.ProjectPlugin 2.9.1 -plugin.projectbuilder.ProjectBuilderPlugin.depend.4=plugin CommonControlsPlugin 1.1 -# }}} Dependencies - -# Menu {{{ -plugin.projectbuilder.ProjectBuilderPlugin.menu=projectBuilder.actions.buildProject projectBuilder.actions.runProject - \ - projectBuilder.actions.toggleToolbar - -plugin.projectbuilder.ProjectBuilderPlugin.menu.code=new projectbuilder.NewProjectMenu() -projectBuilder.actions.newProject.label=Create new Project -projectBuilder.actions.buildProject.label=Build Current Project -projectBuilder.actions.runProject.label=Run Current Project -projectBuilder.actions.toggleToolbar.label=Show Toolbar -#projectBuilder.actions.editBuildSettings.label=Edit Project Build Settings -#projectBuilder.actions.editRunSettings.label=Edit Project Run Settings -# }}} Menu - -# ProjectViewer settings {{{ -options.projectBuilder.pv.options.label=Build/Run Settings -options.projectBuilder.toolbar.visible=false -# }}} ProjectViewer settings - -# Properties {{{ -projectBuilder.run-ant-in-jvm=true -# }}} Properties - -# Messages {{{ -projectBuilder.msg.no-project.title=Error -projectBuilder.msg.no-project.message=No Active Project -projectBuilder.msg.no-build-command.title=Build Error -projectBuilder.msg.no-build-command.message=No build setting chosen for this project.\n\ - To edit build settings right-click on the root project node in ProjectViewer,\n\ - select Properties, and click on the Build/Run Settings option in the left-hand pane. -projectBuilder.msg.no-run-command.title=Run Error -projectBuilder.msg.no-run-command.message=No run setting chosen for this project.\n\ - To edit run settings right-click on the root project node in ProjectViewer,\n\ - select Properties, and click on the Build/Run Settings option in the left-hand pane. -projectBuilder.msg.remove-setting.title=Remove Setting -projectBuilder.msg.remove-setting.message=Are you sure you want to remove this setting? ({0}) -projectBuilder.msg.no-tools-jar.title=Ant Error -projectBuilder.msg.no-tools-jar.message=tools.jar not found -projectBuilder.msg.add-build-command.title=New Build Command -projectBuilder.msg.add-build-command.message=Add this to the list of build commands for this project... -projectBuilder.msg.add-run-command.title=New Run Command -projectBuilder.msg.add-run-command.message=Add this to the list of run commands for this project... -projectBuilder.msg.modify-build-command.title=Modify Build Command -projectBuilder.msg.modify-build-command.message=Change this build command to... -projectBuilder.msg.modify-run-command.title=Modify Run Command -projectBuilder.msg.modify-run-command.message=Change this run command to... -projectBuilder.msg.invalid-build-file.title=Build File -projectBuilder.msg.invalid-build-file.message=That build file doesn't exist. -projectBuilder.msg.project-exists.title=Can't Create Project -projectBuilder.msg.project-exists.message=A project with that name already exists. -projectBuilder.msg.no-ant-farm.title=AntFarm Plugin required -projectBuilder.msg.no-ant-farm.message=In order to build projects using Ant, you must install the AntFarm plugin. -# }}} - -# ::mode=properties:folding=explicit:: \ No newline at end of file Copied: plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props (from rev 17444, plugins/ProjectBuilder/trunk/conf/ProjectBuilder.props) =================================================================== --- plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props (rev 0) +++ plugins/ProjectBuilder/tags/1.1/conf/ProjectBuilder.props 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1,72 @@ +# Basic Plugin Information {{{ +plugin.projectbuilder.ProjectBuilderPlugin.activate=startup +plugin.projectbuilder.ProjectBuilderPlugin.author=Eric Berry, Damien Radtke +plugin.projectbuilder.ProjectBuilderPlugin.description=Provides templates to create new projects of different types. +plugin.projectbuilder.ProjectBuilderPlugin.docs=index.html +plugin.projectbuilder.ProjectBuilderPlugin.longdescription=description.html +plugin.projectbuilder.ProjectBuilderPlugin.name=Project Builder +plugin.projectbuilder.ProjectBuilderPlugin.usePluginHome=true +plugin.projectbuilder.ProjectBuilderPlugin.version=1.0 +# }}} Basic Plugin Information + +# Dependencies {{{ +plugin.projectbuilder.ProjectBuilderPlugin.depend.0=jedit 04.03.18.00 +plugin.projectbuilder.ProjectBuilderPlugin.depend.1=jdk 1.6 +plugin.projectbuilder.ProjectBuilderPlugin.depend.2=plugin com.townsfolkdesigns.jedit.plugins.scripting.GroovyScriptEnginePlugin 1.0.0 +plugin.projectbuilder.ProjectBuilderPlugin.depend.3=plugin projectviewer.ProjectPlugin 2.9.1 +plugin.projectbuilder.ProjectBuilderPlugin.depend.4=plugin CommonControlsPlugin 1.1 +# }}} Dependencies + +# Menu {{{ +plugin.projectbuilder.ProjectBuilderPlugin.menu=projectBuilder.actions.buildProject projectBuilder.actions.runProject - \ + projectBuilder.actions.toggleToolbar - +plugin.projectbuilder.ProjectBuilderPlugin.menu.code=new projectbuilder.NewProjectMenu() +projectBuilder.actions.newProject.label=Create new Project +projectBuilder.actions.buildProject.label=Build Current Project +projectBuilder.actions.runProject.label=Run Current Project +projectBuilder.actions.toggleToolbar.label=Show Toolbar +#projectBuilder.actions.editBuildSettings.label=Edit Project Build Settings +#projectBuilder.actions.editRunSettings.label=Edit Project Run Settings +# }}} Menu + +# ProjectViewer settings {{{ +#options.projectBuilder.pv.options.jEdit_Plugin.label=jEdit Plugin Properties +options.projectBuilder.pv.options.Java_Application.label=Java App Properties +options.projectBuilder.pv.build-run-options.label=Build/Run settings +options.projectBuilder.toolbar.visible=false +# }}} ProjectViewer settings + +# Messages {{{ +projectBuilder.msg.no-shell.title=Shell Error +projectBuilder.msg.no-shell.message=This action requires the {0} shell. Please install it and try again. +projectBuilder.msg.no-project.title=Error +projectBuilder.msg.no-project.message=No Active Project +projectBuilder.msg.no-build-command.title=Build Error +projectBuilder.msg.no-build-command.message=No build setting chosen for this project.\n\ + To edit build settings right-click on the root project node in ProjectViewer,\n\ + select Properties, and click on the Build/Run Settings option in the left-hand pane. +projectBuilder.msg.no-run-command.title=Run Error +projectBuilder.msg.no-run-command.message=No run setting chosen for this project.\n\ + To edit run settings right-click on the root project node in ProjectViewer,\n\ + select Properties, and click on the Build/Run Settings option in the left-hand pane. +projectBuilder.msg.remove-setting.title=Remove Setting +projectBuilder.msg.remove-setting.message=Are you sure you want to remove this setting? ({0}) +projectBuilder.msg.no-tools-jar.title=Ant Error +projectBuilder.msg.no-tools-jar.message=tools.jar not found +projectBuilder.msg.add-build-command.title=New Build Command +projectBuilder.msg.add-build-command.message=Add this to the list of build commands for this project... +projectBuilder.msg.add-run-command.title=New Run Command +projectBuilder.msg.add-run-command.message=Add this to the list of run commands for this project... +projectBuilder.msg.modify-build-command.title=Modify Build Command +projectBuilder.msg.modify-build-command.message=Change this build command to... +projectBuilder.msg.modify-run-command.title=Modify Run Command +projectBuilder.msg.modify-run-command.message=Change this run command to... +projectBuilder.msg.invalid-build-file.title=Build File +projectBuilder.msg.invalid-build-file.message=That build file doesn't exist. +projectBuilder.msg.project-exists.title=Can't Create Project +projectBuilder.msg.project-exists.message=A project with that name already exists. +projectBuilder.msg.no-ant-farm.title=AntFarm Plugin required +projectBuilder.msg.no-ant-farm.message=In order to build projects using Ant, you must install the AntFarm plugin. +# }}} + +# ::mode=properties:folding=explicit:: Deleted: plugins/ProjectBuilder/tags/1.1/conf/services.xml =================================================================== --- plugins/ProjectBuilder/trunk/conf/services.xml 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/conf/services.xml 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,11 +0,0 @@ -<!DOCTYPE SERVICES SYSTEM "services.dtd"> -<SERVICES> - <!-- - <SERVICE CLASS="projectviewer.action.Action" NAME="PVMenu"> - new projectbuilder.actions.PVMenu(); - </SERVICE> - --> - <SERVICE CLASS="projectviewer.config.OptionsService" NAME="ProjectBuilder Settings"> - new projectbuilder.options.BuildRunOptionsService(); - </SERVICE> -</SERVICES> \ No newline at end of file Copied: plugins/ProjectBuilder/tags/1.1/conf/services.xml (from rev 17444, plugins/ProjectBuilder/trunk/conf/services.xml) =================================================================== --- plugins/ProjectBuilder/tags/1.1/conf/services.xml (rev 0) +++ plugins/ProjectBuilder/tags/1.1/conf/services.xml 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1,14 @@ +<!DOCTYPE SERVICES SYSTEM "services.dtd"> +<SERVICES> + <!-- + <SERVICE CLASS="projectviewer.action.Action" NAME="PVMenu"> + new projectbuilder.actions.PVMenu(); + </SERVICE> + --> + <SERVICE CLASS="projectviewer.config.OptionsService" NAME="ProjectBuilder Build/Run Settings"> + new projectbuilder.options.BuildRunOptionsService(); + </SERVICE> + <SERVICE CLASS="projectviewer.config.OptionsService" NAME="ProjectBuilder Project Settings"> + new projectbuilder.options.ProjectOptionsService(); + </SERVICE> +</SERVICES> \ No newline at end of file Deleted: plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy =================================================================== --- plugins/ProjectBuilder/trunk/source/main/resources/templates/Base.groovy 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,207 +0,0 @@ -/** -NOTE!! Editing this file will do nothing unless the plugin dir is deleted, -then this plugin is reloaded -*/ -// imports {{{ -import groovy.swing.SwingBuilder -import java.awt.GridBagConstraints as GBC -import javax.swing.* -import javax.swing.SwingConstants as SC -import javax.swing.WindowConstants as WC -import projectbuilder.ProjectBuilderPlugin -import projectbuilder.builder.ProjectBuilder as PB -import projectbuilder.utils.PVUtils - -import org.gjt.sp.jedit.EditPlugin -import org.gjt.sp.jedit.browser.VFSBrowser -import org.gjt.sp.jedit.browser.VFSFileChooserDialog -import org.gjt.sp.jedit.jEdit as JEDIT -import org.gjt.sp.jedit.View -import org.gjt.sp.jedit.io.VFSManager -import org.gjt.sp.jedit.Macros -import org.gjt.sp.jedit.GUIUtilities -import org.gjt.sp.util.Log - -import projectviewer.ProjectManager; -import projectviewer.ProjectViewer; -import projectviewer.vpt.VPTProject; -import projectviewer.vpt.VPTGroup; -import projectviewer.vpt.VPTNode; -import projectviewer.vpt.VPTRoot; -import projectviewer.importer.RootImporter -// }}} - -View view = JEDIT.getActiveView() - -// Get project types. -File pluginHome = EditPlugin.getPluginHome(ProjectBuilderPlugin.class) ?: new File(System.getProperty("user.dir"), "build") -if(!pluginHome.exists()) { - pluginHome.mkdirs() -} -File templatesDir = new File(pluginHome as File, "templates") -File userTemplatesDir = new File(ProjectBuilderPlugin.userTemplateDir) -if(!templatesDir.exists()) { - templatesDir.mkdirs() -} -if (!userTemplatesDir.exists()) { - userTemplatesDir.mkdir() -} -def templateTypes = [] - -int i = 0 -int selected = 0 - -templatesDir.eachDir { dir -> - templateTypes << new TemplateTypeOption(name: dir.name, dir: dir, templatesDir: templatesDir) - if (dir.name == projectType) selected = i - i++ -} -userTemplatesDir.eachDir { dir -> - templateTypes << new TemplateTypeOption(name: dir.name, dir: dir, templatesDir: userTemplatesDir) - if (dir.name == projectType) selected = i - i++ -} - -// Create the form -def swing = new SwingBuilder() -def form = swing.panel() { - gridBagLayout() - def gbc = swing.gbc(gridx: 0, gridy: 0, weightx: 0.0f, weighty: 0.0f, gridwidth: 1, gridheight: 1, fill: GBC.HORIZONTAL) - - // set up the labels. - gbc.insets = [10, 10, 0, 0] - label(text: "Name:", horizontalAlignment: SC.RIGHT, constraints: gbc) - gbc.insets = [5, 10, 0, 0] - gbc.gridy++ - label(text: "Type:", horizontalAlignment: SC.RIGHT, constraints: gbc) - gbc.gridy++; - label(text: "Group:", horizontalAlignment: SC.RIGHT, constraints: gbc) - gbc.gridy++ - label(text: "Directory:", horizontalAlignment: SC.RIGHT, constraints: gbc) - gbc.gridy++ - label(text: "*", horizontalAlignment: SC.RIGHT, constraints: gbc) - - // set up fields - gbc.gridx = 1 - gbc.gridy = 0 - gbc.weightx = 1.0f - gbc.weighty = 0.0f - gbc.insets = [10, 5, 0, 0] - textField(id: "name_field", columns: 30, constraints: gbc) - gbc.gridy++ - comboBox(id: "type_field", items: templateTypes, constraints: gbc, selectedIndex: selected) - gbc.gridy++ - groups = PVUtils.listGroups() - comboBox(id: "group_field", items: PVUtils.groupNames(), constraints: gbc) - gbc.gridy++ - String workspace = JEDIT.getProperty("projectBuilder.workspace", System.getProperty("user.home")+File.separator+"workspace"); - textField(id: "directory_field", columns: 30, text: workspace , constraints: gbc) - gbc.gridy++ - gbc.insets = [10, 5, 10, 0] - label(text: "<html><small>Project will be created in [Directory]${File.separator}[Name]</small></html>", constraints: gbc) - - // add browse button - gbc.gridy = 3 - gbc.gridx = 2 - gbc.insets = [10, 5, 0, 10] - button(text: "...", constraints: gbc, actionPerformed: { - VFSFileChooserDialog chooser = new VFSFileChooserDialog(view, buffer.directory, VFSBrowser.CHOOSE_DIRECTORY_DIALOG, false, true) - directory_field.text = chooser.selectedFiles?.getAt(0) - }) -} - -// QUESTION: Should we find a custom icon for this? I like this better than the generic question mark -def answer = JOptionPane.showConfirmDialog(view, form, "Create a new Project", - JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, - GUIUtilities.loadIcon("22x22/actions/application-run.png")) - -if(answer == JOptionPane.OK_OPTION) { - def templateType = swing.type_field.selectedItem - def projectGroup = groups[swing.group_field.selectedIndex] - def projectName = swing.name_field.text - def projectDir = new File(swing.directory_field.text) - def project = new Project(name: swing.name_field.text, directory: projectDir, build: [], run: []) - String[] roots = [templatesDir.path] - - // Make sure a project with the chosen name doesn't already exist - ProjectManager manager = ProjectManager.getInstance() - try { - if (manager.getProject(projectName) != null) { - GUIUtilities.error(view, "projectBuilder.msg.project-exists", null) - return - } - } catch (Exception e) { - // Assume this means that it's null. Do nothing - } - - println(" type: " + templateType) - println(" name: " + projectName) - println(" dir: " + projectDir) - println(" script: " + templateType.scriptPath) - - JEDIT.setProperty("projectBuilder.workspace", swing.directory_field.text); - - Binding binding = new Binding() - GroovyScriptEngine gse = new GroovyScriptEngine(roots) - binding.setVariable("project", project) - binding.setVariable("templatesDir", templatesDir) - binding.setVariable("view", view) - binding.setVariable("buffer", buffer) - binding.setVariable("editPane", editPane) - binding.setVariable("textArea", textArea) - binding.setVariable("wm", wm) - binding.setVariable("scriptPath", templateType.scriptPath); - binding.setVariable("abort", false) - binding.setVariable("open", []) - gse.run(templateType.scriptPath, binding) - - // If abort wasn't set to true, create the project in ProjectViewer - if (!binding.getVariable("abort")) { - try { - view.getDockableWindowManager().addDockableWindow("projectviewer") - VPTProject proj = new VPTProject(project.name) - proj.setRootPath(project.directory.getPath()+File.separator+project.name) - for (int j = 0; j<project.build.size(); j++) { - if (j == 0) proj.setProperty("projectBuilder.command.build", project.build.get(j)) - proj.setProperty("projectBuilder.command.build."+j, project.build.get(j)) - } - for (int k = 0; k<project.run.size(); k++) { - if (k == 0) proj.setProperty("projectBuilder.command.run", project.run.get(k)) - proj.setProperty("projectBuilder.command.run."+k, project.run.get(k)); - } - ProjectViewer viewer = ProjectViewer.getViewer(view) - manager.addProject(proj, projectGroup) - viewer.setRootNode(proj) - new RootImporter(proj, viewer, true).doImport() - VFSManager.waitForRequests() - for (String s : binding.getVariable("open")) { - JEDIT.openFile(view, s) - } - } catch (Exception e) { - Log.log(Log.ERROR, ProjectBuilderPlugin.class, e.toString()+": "+e.getMessage()) - e.printStackTrace() - } - } -} - -class TemplateTypeOption { - String name - File dir - File templatesDir - - String getScriptPath() { - File scriptFile = new File(dir, "${name}.groovy") - return scriptFile.path - "${templatesDir.path}${File.separator}" - } - - String toString() { - name.replaceAll('_', ' ') - } -} - -class Project { - String name - File directory - ArrayList build - ArrayList run -} \ No newline at end of file Copied: plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy (from rev 17444, plugins/ProjectBuilder/trunk/source/main/resources/templates/Base.groovy) =================================================================== --- plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy (rev 0) +++ plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/Base.groovy 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1,210 @@ +/** +NOTE!! Editing this file will do nothing unless the plugin dir is deleted, +then this plugin is reloaded +*/ +// imports {{{ +import groovy.swing.SwingBuilder +import java.awt.GridBagConstraints as GBC +import javax.swing.* +import javax.swing.SwingConstants as SC +import javax.swing.WindowConstants as WC +import projectbuilder.ProjectBuilderPlugin +import projectbuilder.builder.ProjectBuilder as PB +import projectbuilder.utils.PVUtils + +import org.gjt.sp.jedit.EditPlugin +import org.gjt.sp.jedit.browser.VFSBrowser +import org.gjt.sp.jedit.browser.VFSFileChooserDialog +import org.gjt.sp.jedit.jEdit as JEDIT +import org.gjt.sp.jedit.View +import org.gjt.sp.jedit.io.VFSManager +import org.gjt.sp.jedit.Macros +import org.gjt.sp.jedit.GUIUtilities +import org.gjt.sp.util.Log + +import projectviewer.ProjectManager; +import projectviewer.ProjectViewer; +import projectviewer.vpt.VPTProject; +import projectviewer.vpt.VPTGroup; +import projectviewer.vpt.VPTNode; +import projectviewer.vpt.VPTRoot; +import projectviewer.importer.RootImporter +// }}} + +View view = JEDIT.getActiveView() + +// Get project types. +//File pluginHome = EditPlugin.getPluginHome(ProjectBuilderPlugin.class) ?: new File(System.getProperty("user.dir"), "build") +File pluginHome = EditPlugin.getPluginHome(ProjectBuilderPlugin.class) +if(!pluginHome.exists()) { + pluginHome.mkdirs() +} +File templatesDir = new File(ProjectBuilderPlugin.templateDir) +File userTemplatesDir = new File(ProjectBuilderPlugin.userTemplateDir) +if(!templatesDir.exists()) { + templatesDir.mkdirs() +} +if (!userTemplatesDir.exists()) { + userTemplatesDir.mkdir() +} +def templateTypes = [] + +int i = 0 +int selected = 0 + +templatesDir.eachDir { dir -> + templateTypes << new TemplateTypeOption(name: dir.name, dir: dir, templatesDir: templatesDir) + if (dir.name == projectType) selected = i + i++ +} +userTemplatesDir.eachDir { dir -> + templateTypes << new TemplateTypeOption(name: dir.name, dir: dir, templatesDir: userTemplatesDir) + if (dir.name == projectType) selected = i + i++ +} + +// Create the form +def swing = new SwingBuilder() +def form = swing.panel() { + gridBagLayout() + def gbc = swing.gbc(gridx: 0, gridy: 0, weightx: 0.0f, weighty: 0.0f, gridwidth: 1, gridheight: 1, fill: GBC.HORIZONTAL) + + // set up the labels. + gbc.insets = [10, 10, 0, 0] + label(text: "Name:", horizontalAlignment: SC.RIGHT, constraints: gbc) + gbc.insets = [5, 10, 0, 0] + gbc.gridy++ + label(text: "Type:", horizontalAlignment: SC.RIGHT, constraints: gbc) + gbc.gridy++; + label(text: "Group:", horizontalAlignment: SC.RIGHT, constraints: gbc) + gbc.gridy++ + label(text: "Directory:", horizontalAlignment: SC.RIGHT, constraints: gbc) + gbc.gridy++ + label(text: "*", horizontalAlignment: SC.RIGHT, constraints: gbc) + + // set up fields + gbc.gridx = 1 + gbc.gridy = 0 + gbc.weightx = 1.0f + gbc.weighty = 0.0f + gbc.insets = [10, 5, 0, 0] + textField(id: "name_field", columns: 30, constraints: gbc) + gbc.gridy++ + comboBox(id: "type_field", items: templateTypes, constraints: gbc, selectedIndex: selected) + gbc.gridy++ + groups = PVUtils.listGroups() + comboBox(id: "group_field", items: PVUtils.groupNames(), constraints: gbc) + gbc.gridy++ + String workspace = JEDIT.getProperty("projectBuilder.workspace", System.getProperty("user.home")+File.separator+"workspace"); + textField(id: "directory_field", columns: 30, text: workspace , constraints: gbc) + gbc.gridy++ + gbc.insets = [10, 5, 10, 0] + label(text: "<html><small>Project will be created in [Directory]${File.separator}[Name]</small></html>", constraints: gbc) + + // add browse button + gbc.gridy = 3 + gbc.gridx = 2 + gbc.insets = [10, 5, 0, 10] + button(text: "...", constraints: gbc, actionPerformed: { + VFSFileChooserDialog chooser = new VFSFileChooserDialog(view, buffer.directory, VFSBrowser.CHOOSE_DIRECTORY_DIALOG, false, true) + directory_field.text = chooser.selectedFiles?.getAt(0) + }) +} + +// QUESTION: Should we find a custom icon for this? I like this better than the generic question mark +def answer = JOptionPane.showConfirmDialog(view, form, "Create a new Project", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, + GUIUtilities.loadIcon("22x22/actions/application-run.png")) + +if(answer == JOptionPane.OK_OPTION) { + def templateType = swing.type_field.selectedItem + def projectGroup = groups[swing.group_field.selectedIndex] + def projectName = swing.name_field.text + def projectDir = new File(swing.directory_field.text) + def project = new Project(name: swing.name_field.text, directory: projectDir, build: [], run: []) + String[] roots = [templatesDir.path] + + // Make sure a project with the chosen name doesn't already exist + ProjectManager manager = ProjectManager.getInstance() + try { + if (manager.getProject(projectName) != null) { + GUIUtilities.error(view, "projectBuilder.msg.project-exists", null) + return + } + } catch (Exception e) { + // Assume this means that it's null. Do nothing + } + + println(" type: " + templateType) + println(" name: " + projectName) + println(" dir: " + projectDir) + println(" script: " + templateType.scriptPath) + + JEDIT.setProperty("projectBuilder.workspace", swing.directory_field.text); + + Binding binding = new Binding() + GroovyScriptEngine gse = new GroovyScriptEngine(roots) + binding.setVariable("project", project) + binding.setVariable("templatesDir", templatesDir) + binding.setVariable("view", view) + binding.setVariable("buffer", buffer) + binding.setVariable("editPane", editPane) + binding.setVariable("textArea", textArea) + binding.setVariable("wm", wm) + binding.setVariable("scriptPath", templateType.scriptPath); + binding.setVariable("abort", false) + binding.setVariable("open", []) + gse.run(templateType.scriptPath, binding) + + // If abort wasn't set to true, create the project in ProjectViewer + if (!binding.getVariable("abort")) { + try { + view.getDockableWindowManager().addDockableWindow("projectviewer") + VPTProject proj = new VPTProject(project.name) + proj.setRootPath(project.directory.getPath()+File.separator+project.name) + for (int j = 0; j<project.build.size(); j++) { + if (j == 0) proj.setProperty("projectBuilder.command.build", project.build.get(j)) + proj.setProperty("projectBuilder.command.build."+j, project.build.get(j)) + } + for (int k = 0; k<project.run.size(); k++) { + if (k == 0) proj.setProperty("projectBuilder.command.run", project.run.get(k)) + proj.setProperty("projectBuilder.command.run."+k, project.run.get(k)) + } + proj.setProperty("projectBuilder.template-dir", templateType.templatesDir.getPath()) + proj.setProperty("projectBuilder.template-name", templateType.name) + ProjectViewer viewer = ProjectViewer.getViewer(view) + manager.addProject(proj, projectGroup) + viewer.setRootNode(proj) + new RootImporter(proj, viewer, true).doImport() + VFSManager.waitForRequests() + for (String s : binding.getVariable("open")) { + JEDIT.openFile(view, s) + } + } catch (Exception e) { + Log.log(Log.ERROR, ProjectBuilderPlugin.class, e.toString()+": "+e.getMessage()) + e.printStackTrace() + } + } +} + +class TemplateTypeOption { + String name + File dir + File templatesDir + + String getScriptPath() { + File scriptFile = new File(dir, "${name}.groovy") + return scriptFile.path - "${templatesDir.path}${File.separator}" + } + + String toString() { + name.replaceAll('_', ' ') + } +} + +class Project { + String name + File directory + ArrayList build + ArrayList run +} \ No newline at end of file Deleted: plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template =================================================================== --- plugins/ProjectBuilder/trunk/source/main/resources/templates/jEdit_Plugin/PluginDescription.template 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template 2010-03-10 00:10:20 UTC (rev 17445) @@ -1 +0,0 @@ -<html><p>Fill this in.</p></html> Copied: plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template (from rev 17444, plugins/ProjectBuilder/trunk/source/main/resources/templates/jEdit_Plugin/PluginDescription.template) =================================================================== --- plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template (rev 0) +++ plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/PluginDescription.template 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1 @@ +Fill this in. Deleted: plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy =================================================================== --- plugins/ProjectBuilder/trunk/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,38 +0,0 @@ -import projectbuilder.builder.ProjectBuilder as PB - -def pluginPackage = project.name.toLowerCase() -def pluginClass = "${project.name}Plugin" -def templateDir = "${templatesDir}/jEdit_Plugin" - -def templateData = [:] -templateData.pluginPackage = pluginPackage -templateData.pluginClass = pluginClass -templateData.project = project -templateData.userName = System.getProperty("user.name") - -PB.build(project.name, project.directory.path) { - d("docs") { - f("${project.name}.html") - } - d("lib") - d("src") { - d(pluginPackage) { - f("${pluginClass}.java", template: "${templateDir}/PluginClass.template", templateData: templateData) - } - } - d("test") { - d(pluginPackage) { - f("${pluginClass}Tests.java") - } - } - f("actions.xml") - f("dockables.xml") - f("services.xml") - f("${project.name}.props", template: "${templateDir}/PluginProps.template", templateData: templateData) - f("build.xml", template: "${templateDir}/PluginBuild.template", templateData: templateData) - f("description.html", template: "${templateDir}/PluginDescription.template", templateData: templateData) - f("sample.build.properties") -} -project.build.add("Build jEdit Plugin:ANT[target=,buildfile=${project.directory.path}/${project.name}/build.xml]") -project.build.add("Clean:ANT[target=clean,buildfile=${project.directory.path}/${project.name}/build.xml]") -/* ::mode=groovy:folding=indent:noTabs=true:: */ \ No newline at end of file Copied: plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy (from rev 17444, plugins/ProjectBuilder/trunk/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy) =================================================================== --- plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy (rev 0) +++ plugins/ProjectBuilder/tags/1.1/source/main/resources/templates/jEdit_Plugin/jEdit_Plugin.groovy 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1,41 @@ +import projectbuilder.builder.ProjectBuilder as PB + +def pluginPackage = project.name.toLowerCase() +def pluginClass = "${project.name}Plugin" +def templateDir = "${templatesDir}/jEdit_Plugin" + +def templateData = [:] +templateData.pluginPackage = pluginPackage +templateData.pluginClass = pluginClass +templateData.project = project +templateData.userName = System.getProperty("user.name") + +PB.build(project.name, project.directory.path) { + d("docs") { + f("${project.name}.html") + } + d("lib") + d("src") { + d(pluginPackage) { + f("${pluginClass}.java", template: "${templateDir}/PluginClass.template", templateData: templateData) + } + } + d("test") { + d(pluginPackage) { + f("${pluginClass}Tests.java") + } + } + f("actions.xml") + f("dockables.xml") + f("services.xml") + f("${project.name}.props", template: "${templateDir}/PluginProps.template", templateData: templateData) + f("build.xml", template: "${templateDir}/PluginBuild.template", templateData: templateData) + f("description.html", template: "${templateDir}/PluginDescription.template", templateData: templateData) + f("sample.build.properties") +} +project.build.add("Build Jar:ANT[target=build,buildfile=${project.directory.path}/${project.name}/build.xml]") +project.build.add("Docs:ANT[target=docs,buildfile=${project.directory.path}/${project.name}/build.xml]") +project.build.add("Package (Jar & Docs):ANT[target=docs,buildfile=${project.directory.path}/${project.name}/build.xml]") +project.build.add("Compile only:ANT[target=compile,buildfile=${project.directory.path}/${project.name}/build.xml]") +project.build.add("Clean:ANT[target=clean,buildfile=${project.directory.path}/${project.name}/build.xml]") +/* ::mode=groovy:folding=indent:noTabs=true:: */ \ No newline at end of file Deleted: plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy =================================================================== --- plugins/ProjectBuilder/trunk/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy 2010-02-22 00:21:19 UTC (rev 17347) +++ plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy 2010-03-10 00:10:20 UTC (rev 17445) @@ -1,252 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package projectbuilder -// imports {{{ -import projectbuilder.command.Entry -import projectbuilder.command.ShellRunner -import projectbuilder.utils.ZipUtils - -import java.util.* -import java.util.zip.* -import javax.script.ScriptContext -import javax.swing.* - -import org.gjt.sp.jedit.* -import org.gjt.sp.jedit.msg.* -import org.gjt.sp.util.Log -import org.gjt.sp.jedit.jEdit as JEDIT - -import org.apache.tools.ant.Project -import org.apache.tools.ant.ProjectHelper - -import projectviewer.vpt.VPTProject -import projectviewer.vpt.VPTNode -import projectviewer.event.ViewerUpdate -import projectviewer.ProjectViewer -import com.townsfolkdesigns.jedit.plugins.scripting.* -import console.Shell -import console.Console -import antfarm.AntFarmPlugin -// }}} imports -/** - * - * @author elberry - */ -public class ProjectBuilderPlugin extends EditPlugin implements EBComponent { - - private Project building = null; // The currently-building project - public static final String userTemplateDir = JEDIT.getSettingsDirectory()+"/project-templates" - - @Override - public void start() { - Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Start called") - File pluginHome = this.pluginHome - if (!pluginHome.exists()) { - pluginHome.mkdirs() - } - File templatesDir = new File(pluginHome, "templates") - if (!templatesDir.exists()) { - templatesDir.mkdirs() - } - File templatesZipFile = new File(pluginHome, "templates.zip") - if(!templatesZipFile.exists()) { - - PluginJAR pluginJar = getPluginJAR() - ZipFile pluginZip = null - try { - pluginZip = pluginJar.getZipFile() - ZipEntry templatesEntry = pluginZip.getEntry("templates.zip") - if (templatesEntry) { - Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Attempting to extract templates.zip from PluginJar to: ${templatesZipFile.path}") - ZipUtils.copyStream(pluginZip.getInputStream(templatesEntry), templatesZipFile.newOutputStream()) - } - } catch (Exception e) { - Log.log(Log.ERROR, ProjectBuilderPlugin.class, "Error getting plugin zip from plugin jar", e) - } - - - File templatesFile = EditPlugin.getResourcePath(this, "templates.zip") - Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Attempting to extract templates.zip - null: ${(templatesFile == null)} | exists: ${templatesFile.exists()} | path: ${templatesFile.path}") - if (templatesFile?.exists()) { - try { - ZipUtils.extract(templatesFile, templatesDir) - } catch (Exception e) { - Log.log(Log.ERROR, ProjectBuilderPlugin.class, "Error extracting ${templatesFile.name} to: ${templatesDir.path}", e) - } - } - } - updateToolbar() - EditBus.addToBus(this) - } - - @Override - public void stop() { - for (view in JEDIT.getViews()) { - ProjectToolbar.remove(view) - } - EditBus.removeFromBus(this) - } - - public void createNewProject(View view, String projectType) { - Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Create new project: ${ScriptEnginePlugin.class.getCanonicalName()}") - ScriptEnginePlugin plugin = JEDIT.getPlugin(ScriptEnginePlugin.class.getCanonicalName()) - ScriptExecutionDelegate delegate = plugin.getScriptExecutionDelegate() - - ScriptContext scriptContext = ScriptEngineUtilities.getDefaultScriptContext(view) - scriptContext.setAttribute("projectType", projectType, ScriptContext.ENGINE_SCOPE) - - File baseTemplateFile = EditPlugin.getResourcePath(this, "templates/Base.groovy") - if(baseTemplateFile) { - delegate.evaluateString(baseTemplateFile.getText(), "groovy", scriptContext) - } - } - - public void createNewProject(View view) { - createNewProject(view, "") - } - - public void executeCommand(View view, VPTProject proj, Entry.ParsedCommand command) { - String type = command.type() - JEDIT.getAction("error-list-clear").invoke(view) - JEDIT.saveSettings() - if (type.equals("SYSTEM")) { - // Run in system shell - String cmd = command.getProperty("cmd") - String[] commands = new String[2] - commands[0] = "cd \""+proj.getRootPath()+"\"" - commands[1] = cmd - Shell system = Shell.getShell("System") - ShellRunner runner = new ShellRunner(view.getDockableWindowManager(), system, commands) - runner.start() - } - else if (type.equals("ANT")) { - String[] commands = new String[2] - String buildfile = command.getProperty("buildfile") - if (buildfile == null || buildfile.length() == 0) - buildfile = proj.getRootPath()+File.separator+"build.xml" - commands[0] = "+"+buildfile - commands[1] = "!"+command.getProperty("target") - Shell ant = Shell.getShell("Ant") - ShellRunner runner = new ShellRunner(view.getDockableWindowManager(), ant, commands) - runner.start() - } - } - - // TODO: See if there's a way to open the project properties pane with Build/Run Settings selected - public void editSettings(View view) {} - - // Build Project methods {{{ - public void buildProject(View view) { - buildProject(view, projectviewer.ProjectViewer.getActiveProject(view)) - } - - public void buildProject(View view, VPTProject proj) { - if (building != null) - return - if (proj == null) { - GUIUtilities.error(view, "projectBuilder.msg.no-project", null) - return - } - String buildProp = proj.getProperty("projectBuilder.command.build") - if (buildProp == null || buildProp.length() == 0) { - GUIUtilities.error(view, "projectBuilder.msg.no-build-command", null) - return - } - Entry entry = new Entry(buildProp) - executeCommand(view, proj, entry.parse()) - } - - public ArrayList<Entry> getBuildCommands(VPTProject proj) { - ArrayList<Entry> list = new ArrayList<Entry>() - for (int i = 0; true; i++) { - String prop = proj.getProperty("projectBuilder.command.build."+i) - if (prop == null) - break - list.add(new Entry(prop)) - } - return list - } - // }}} Build Project methods - - // Run Project methods {{{ - public void runProject(View view) { - runProject(view, projectviewer.ProjectViewer.getActiveProject(view)) - } - - public void runProject(View view, VPTProject proj) { - if (building != null) - return - if (proj == null) { - GUIUtilities.error(view, "projectBuilder.msg.no-project", null) - return - } - String runProp = proj.getProperty("projectBuilder.command.run") - if (runProp == null || runProp.length() == 0) { - GUIUtilities.error(view, "projectBuilder.msg.no-run-command", null) - return - } - Entry entry = new Entry(runProp) - executeCommand(view, proj, entry.parse()) - } - - public ArrayList<Entry> getRunCommands(VPTProject proj) { - ArrayList<Entry> list = new ArrayList<Entry>() - for (int i = 0; true; i++) { - String prop = proj.getProperty("projectBuilder.command.run."+i) - if (prop == null) - break - list.add(new Entry(prop)) - } - return list - } - // }}} Run Project settings - - // Toolbar methods {{{ - public void toggleToolbar() { - boolean toolbar = !JEDIT.getBooleanProperty("options.projectBuilder.toolbar.visible") - JEDIT.setBooleanProperty("options.projectBuilder.toolbar.visible", toolbar) - updateToolbar(null) - } - - private void updateToolbar(VPTProject proj) { - boolean toolbar = JEDIT.getBooleanProperty("options.projectBuilder.toolbar.visible") - if (toolbar) { - boolean useActive = (proj == null) - for (view in JEDIT.getViews()) { - if (useActive) proj = ProjectViewer.getActiveProject(view) - if (proj == null) continue - ProjectToolbar.create(view, proj) - } - } else { - for (view in JEDIT.getViews()) { - ProjectToolbar.remove(view) - } - } - } - // }}} Toolbar methods - - // Edit Bus - public void handleMessage(EBMessage message) { - if (message instanceof ViewUpdate) { - ViewUpdate view_message = (ViewUpdate) message - boolean toolbar = JEDIT.getBooleanProperty("options.projectBuilder.toolbar.visible") - View view = view_message.getView() - if (view_message.getWhat() == ViewUpdate.CREATED) { - if (toolbar) ProjectToolbar.create(view) - } else if (view_message.getWhat() == ViewUpdate.CLOSED) { - if (toolbar) ProjectToolbar.remove(view) - } - } else if (message instanceof ViewerUpdate) { - ViewerUpdate viewer_message = (ViewerUpdate) message; - VPTNode new_node = viewer_message.getNode() - ProjectToolbar.remove(viewer_message.getView()) - if (new_node.isProject()) { - updateToolbar((VPTProject) new_node) - } - } - } - -} - Copied: plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy (from rev 17444, plugins/ProjectBuilder/trunk/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy) =================================================================== --- plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy (rev 0) +++ plugins/ProjectBuilder/tags/1.1/source/main/src/projectbuilder/ProjectBuilderPlugin.groovy 2010-03-10 00:10:20 UTC (rev 17445) @@ -0,0 +1,268 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package projectbuilder +// imports {{{ +import projectbuilder.command.Entry +import projectbuilder.command.ShellRunner +import projectbuilder.utils.ZipUtils + +import java.util.* +import java.util.zip.* +import javax.script.ScriptContext +import java.io.File +import javax.swing.* + +import org.gjt.sp.jedit.* +import org.gjt.sp.jedit.msg.* +import org.gjt.sp.util.Log +import org.gjt.sp.jedit.jEdit as JEDIT + +import org.apache.tools.ant.Project +import org.apache.tools.ant.ProjectHelper + +import projectviewer.vpt.VPTProject +import projectviewer.vpt.VPTNode +import projectviewer.event.ViewerUpdate +import projectviewer.ProjectViewer +import com.townsfolkdesigns.jedit.plugins.scripting.* +import console.Shell +import console.Console +import antfarm.AntFarmPlugin +// }}} imports +/** + * + * @author elberry, dradtke + */ +public class ProjectBuilderPlugin extends EditPlugin implements EBComponent { + + private Project building = null; // The currently-building project + public static final String templateDir = getPluginHome(this).getPath()+File.separator+"templates" + public static final String userTemplateDir = JEDIT.getSettingsDirectory()+File.separator+"project-templates" + + @Override + public void start() { + Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Start called") + File pluginHome = this.pluginHome + if (!pluginHome.exists()) { + pluginHome.mkdirs() + } + File templatesDir = new File(pluginHome, "templates") + if (!templatesDir.exists()) { + templatesDir.mkdirs() + } + File templatesZipFile = new File(pluginHome, "templates.zip") + if(!templatesZipFile.exists()) { + + PluginJAR pluginJar = getPluginJAR() + ZipFile pluginZip = null + try { + pluginZip = pluginJar.getZipFile() + ZipEntry templatesEntry = pluginZip.getEntry("templates.zip") + if (templatesEntry) { + Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Attempting to extract templates.zip from PluginJar to: ${templatesZipFile.path}") + ZipUtils.copyStream(pluginZip.getInputStream(templatesEntry), templatesZipFile.newOutputStream()) + } + } catch (Exception e) { + Log.log(Log.ERROR, ProjectBuilderPlugin.class, "Error getting plugin zip from plugin jar", e) + } + + + File templatesFile = EditPlugin.getResourcePath(this, "templates.zip") + Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Attempting to extract templates.zip - null: ${(templatesFile == null)} | exists: ${templatesFile.exists()} | path: ${templatesFile.path}") + if (templatesFile?.exists()) { + try { + ZipUtils.extract(templatesFile, templatesDir) + } catch (Exception e) { + Log.log(Log.ERROR, ProjectBuilderPlugin.class, "Error extracting ${templatesFile.name} to: ${templatesDir.path}", e) + } + } + } + updateToolbar(null) + EditBus.addToBus(this) + } + + @Override + public void stop() { + for (view in JEDIT.getViews()) { + ProjectToolbar.remove(view) + } + EditBus.removeFromBus(this) + } + + public void createNewProject(View view, String projectType) { + Log.log(Log.DEBUG, ProjectBuilderPlugin.class, "Create new project: ${ScriptEnginePlugin.class.getCanonicalName()}") + ScriptEnginePlugin plugin = JEDIT.getPlugin(ScriptEnginePlugin.class.getCanonicalName()) + ScriptExecutionDelegate delegate = plugin.getScriptExecutionDelegate() + + ScriptContext scriptContext = ScriptEngineUtilities.getDefaultScriptContext(view) + scriptContext.setAttribute("projectType", projectType, ScriptContext.ENGINE_SCOPE) + + File baseTemplateFile = EditPlugin.getResourcePath(this, "templates/Base.groovy") + if(baseTemplateFile) { + delegate.evaluateString(baseTemplateFile.getText(), "groovy", scriptContext) + } + } + + public void createNewProject(View view) { + createNewProject(view, "") + } + + public void executeCommand(View view, VPTProject proj, Entry.ParsedCommand command) { + String type = command.type() + JEDIT.getAction("error-list-clear").invoke(view) + JEDIT.saveSettings() + if (type.equals("SYSTEM")) { + // Run in system shell + String cmd = command.getProperty("cmd") + String[] commands = new String[2] + commands[0] = "cd \""+proj.getRootPath()+"\"" + commands[1] = cmd + ShellRunner runner = new ShellRunner(view, "System", commands) + runner.start() + } + else if (type.equals("ANT")) { + String[] commands = new String[2] + String buildfile = command.getProperty("buildfile") + if (buildfile == null || buildfile.length() == 0) + buildfile = proj.getRootPath()+File.separator+"build.xml" + commands[0] = "+"+buildfile + commands[1] = "!"+command.getProperty("target") + ShellRunner runner = new ShellRunner(view, "Ant", commands) + runner.start() + } + } + + // TODO: See if there's a way to open the project properties pane with Build/Run Settings selected + public void editSettings(View view) {} + + // Build Project methods {{{ + public void buildProject(View view) { + buildProject(view, projectviewer.ProjectViewer.getActiveProject(view)) + } + + public void b... [truncated message content] |