Wrong template for folder type plugins
Hi,
I just tried to convert the Hello World Plugin into a folder type plugin, by using this build.xml
<?xml version="1.0" ?>
<project name="HelloWorld" default="distribute" basedir=".">
<property file="plugin.properties"/>
<property name="build" location="build"/>
<property name="classes" location="classes"/>
<property name="src" location="src"/>
<path id="classpath">
<fileset dir="../GeneiousFiles/lib">
<include name="GeneiousPublicAPI.jar"/>
<include name="jdom.jar"/>
<include name="jebl.jar"/>
</fileset>
</path>
<target name= "distribute" depends="build">
<!--<copy file="${build}/${short-plugin-name}.jar" tofile="${build}/${short-plugin-name}.gplugin"/>-->
<echo message="Created ${build}/${short-plugin-name}.gplugin"/>
<!--If your plugin consists of a folder you should build it into
a zip file with extension gplugin. See commented example below.
Remove above line and uncomment these to use-->
<zip zipfile="${build}/${short-plugin-name}.gplugin">
<fileset dir="${build}/${plugin-name}"/>
</zip>
</target>
<target name="build" depends="compile">
<!--
<jar jarfile="${build}/${short-plugin-name}.jar">
<fileset dir="${classes}"/>
<fileset dir="">
<include name="plugin.properties"/>
</fileset>
</jar>
-->
<!--build example for folder type plugin. Remove above
lines and uncomment these to use-->
<jar jarfile="${build}/${short-plugin-name}.jar">
<fileset dir="${classes}"/>
</jar>
<mkdir dir="${build}/${plugin-name}"/>
<copy todir="${build}/${plugin-name}">
<fileset dir="${build}">
<include name="ExtraFiles"/>
<include name="ExtraFiles/*"/>
<include name="${short-plugin-name}.jar"/>
</fileset>
<!--<fileset dir="docs">-->
<!--<include name="readme.txt"/>-->
<!--</fileset>-->
</copy>
</target>
<target name="compile" depends="prepare">
<javac target="1.8" source="1.8" destdir="${classes}" debug="true">
<classpath refid="classpath"/>
<src path="${src}"/>
</javac>
</target>
<target name="prepare">
<mkdir dir="${build}"/>
<mkdir dir="${classes}"/>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${classes}"/>
</target>
</project>
This creates this result:
So you template is wrong for folder type plugins. :-(
0
-
I found the problem, the zip statement does not do the right thing in the template:
<zip zipfile="${build}/${short-plugin-name}.gplugin">
<!--works-->
<fileset dir="${build}">
<include name="${plugin-name}/**/*"/>
</fileset>
<!--from hello world, does not work-->
<!--<fileset dir="${build}/${plugin-name}"/>-->
</zip>So the template is definitely wrong for the folder type plugins. Took me half a day to figure out.
And yes, I am an ant newbie.
A simple listing like this in the doc would have made this clear:
tag-mac-11:examples janosch$ unzip -l GsonTestPlugin/build/GsonTestPlugin.gplugin
Archive: GsonTestPlugin/build/GsonTestPlugin.gplugin
Length Date Time Name
-------- ---- ---- ----
0 09-28-17 15:08 de.mpicbg.gef.gsontest.GsonTestPlugin/
3100 09-28-17 15:08 de.mpicbg.gef.gsontest.GsonTestPlugin/de.mpicbg.gef.gsontest.GsonTestPlugin.jar
232620 09-28-17 15:08 de.mpicbg.gef.gsontest.GsonTestPlugin/gson-2.8.1.jar
-------- -------
235720 3 filesCheers!
Stephan
0 -
Hi Stephan,
Glad you got it sorted out in the end. We'll update our documentation and devkit template.
Cheers,
Matthew0
Please sign in to leave a comment.
Comments
2 comments