2 followers Follow

Wrong template for folder type plugins


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=""/>
<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"/>

<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}"/>

<target name="build" depends="compile">
<jar jarfile="${build}/${short-plugin-name}.jar">
<fileset dir="${classes}"/>
<fileset dir="">
<include name=""/>

<!--build example for folder type plugin. Remove above
lines and uncomment these to use-->
<jar jarfile="${build}/${short-plugin-name}.jar">
<fileset dir="${classes}"/>
<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 dir="docs">-->
<!--<include name="readme.txt"/>-->

<target name="compile" depends="prepare">
<javac target="1.8" source="1.8" destdir="${classes}" debug="true">
<classpath refid="classpath"/>
<src path="${src}"/>

<target name="prepare">
<mkdir dir="${build}"/>
<mkdir dir="${classes}"/>

<target name="clean">
<delete dir="${build}"/>
<delete dir="${classes}"/>

This creates this result:

So you template is wrong for folder type plugins. :-(

Stephan Janosch

Please sign in to leave a comment.



I found the problem, the zip statement does not do the right thing in the template:

 <zip zipfile="${build}/${short-plugin-name}.gplugin">
<fileset dir="${build}">
<include name="${plugin-name}/**/*"/>

<!--from hello world, does not work-->
<!--<fileset dir="${build}/${plugin-name}"/>-->

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 files




Stephan Janosch 0 votes
Comment actions Permalink

Hi Stephan,

Glad you got it sorted out in the end.  We'll update our documentation and devkit template.


Matthew Cheung 0 votes
Comment actions Permalink