New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid plugin manifest #6
Comments
These properties are retrieved from the SCM (svn or git). How did you build your plugin? |
I built it with my command line, using the simple |
This is my
|
it should work out the box if you have the standard JOSM plugin directory structure (https://josm.openstreetmap.de/browser/osm/applications/editors/josm/plugins) AND your plugin folder is a valid Git or SVN repository. Check if the following works from build-common.xml: <!--
** Initializes the REVISION.XML file from git-svn information.
Obtains the revision from the git-svn-id field.
-->
<target name="init-git-svn-revision-xml" if="svn.info.fail" unless="skip-revision">
<exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.svn.info.result">
<arg value="log"/>
<arg value="-1"/>
<arg value="--grep=git-svn-id"/>
<!--
%B: raw body (unwrapped subject and body)
%n: new line
%ai: author date, ISO 8601 format
-->
<arg value="--pretty=format:%B%n%ai"/>
<arg value="."/>
</exec>
<replaceregexp file="REVISION.XML" flags="s"
match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
<condition property="git.svn.fail">
<not>
<and>
<equals arg1="${git.svn.info.result}" arg2="0" />
<length file="REVISION.XML" when="greater" length="1" />
</and>
</not>
</condition>
</target>
<!--
** Initializes the REVISION.XML file from git (w/o svn) information.
Uses Unix date as revision number.
-->
<target name="init-git-revision-xml" if="git.svn.fail" unless="skip-revision">
<exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.info.result">
<arg value="log"/>
<arg value="-1"/>
<arg value="--pretty=format:%at%n%ai"/>
<arg value="."/>
</exec>
<replaceregexp file="REVISION.XML" flags="s"
match="\s*(\d*)\s+(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
<condition property="git.fail">
<not>
<and>
<equals arg1="${git.info.result}" arg2="0" />
<length file="REVISION.XML" when="greater" length="1" />
</and>
</not>
</condition>
</target>
<target name="init-revision-fallback" if="git.fail" unless="skip-revision">
<tstamp>
<format property="current.time" pattern="yyyy-MM-dd'T'HH:mm:ss.SSS" />
</tstamp>
<echo file="REVISION.XML"><![CDATA[<info><entry><commit revision="UNKNOWN"><date>${current.time}</date></commit></entry></info>]]></echo>
</target>
<target name="revision" depends="init-svn-revision-xml, init-git-svn-revision-xml, init-git-revision-xml, init-revision-fallback" unless="skip-revision">
<xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
<delete file="REVISION.XML"/>
</target> The manifest is then built as follows (still in build-common.xml): <manifest file="${manifest}" mode="update">
<attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
<attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
<attribute name="Plugin-Class" value="${plugin.class}" />
<attribute name="Plugin-Description" value="${plugin.description}" />
<attribute name="Plugin-Date" value="${version.entry.commit.date}" />
<attribute name="Author" value="${plugin.author}"/>
</manifest>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Link"/>
<param name="property.name" value="plugin.link"/>
<param name="property.value" value="${plugin.link}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Icon"/>
<param name="property.name" value="plugin.icon"/>
<param name="property.value" value="${plugin.icon}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Early"/>
<param name="property.name" value="plugin.early"/>
<param name="property.value" value="${plugin.early}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Provides"/>
<param name="property.name" value="plugin.provides"/>
<param name="property.value" value="${plugin.provides}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Requires"/>
<param name="property.name" value="plugin.requires"/>
<param name="property.value" value="${plugin.requires}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Stage"/>
<param name="property.name" value="plugin.stage"/>
<param name="property.value" value="${plugin.stage}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Canloadatruntime"/>
<param name="property.name" value="plugin.canloadatruntime"/>
<param name="property.value" value="${plugin.canloadatruntime}"/>
</antcall>
<antcall target="add-manifest-attribute">
<param name="manifest.attribute" value="Plugin-Minimum-Java-Version"/>
<param name="property.name" value="plugin.minimum.java.version"/>
<param name="property.value" value="${plugin.minimum.java.version}"/>
</antcall>
<antcall target="additional-manifest" /> |
Did you make progress? Your plugin is the only one failing our integration tests. It cannot remain in the default list of JOSM plugins if the manifest is not correct. |
No, I wasn't able to. Should I try using ant publish or something instead of ant dist? |
No, ant dist is the way to go. It looks like like you built your plugin from an extracted zip archive instead of a cloned git repository? |
I've built it from the source code on my computer. I've got the plugin as a checked out git repository, and the rest as a checked out svn repository. Could the issue be that the plugin source code isn't part of an SVN repo? |
From a valid Git repository it should work too. |
Maybe the commandline tools are missing? There must be a "git" executable callable. |
@BjornRasmussen I've removed the plugin from the default list until this issue is fixed, please add it back once you manage to release a version with a correct manifest: https://josm.openstreetmap.de/wiki/PluginsSource?action=diff&version=653&old_version=652 |
@BjornRasmussen : If you don't mind using |
I just created a workflow for releases. We might want to do the same thing for other GitHub plugins, which means we would want to copy the action into its own repository for reuse. |
Mandatory manifest entries
Plugin-Version
andPlugin-Date
are not correctly filled:https://josm.openstreetmap.de/plugin
The text was updated successfully, but these errors were encountered: