Abnaxos / markdown-doclet

A Doclet that allows the use of Markdown in JavaDoc comments.
GNU General Public License v3.0
319 stars 40 forks source link

added support for android #50

Closed robbatt closed 8 years ago

robbatt commented 8 years ago

Hi Raffael,

habe das ganze noch minimaler gelöst. Ich prüfe nur noch ob eines der notwendigen plugins bereits im pluginmanager vorhanden ist. Falls nicht fliegt eine Exception. Das ist weniger restriktiv als explizit das java plugin per apply zu erzwingen.

Leider bekomme ich das ganze nicht getestet, das plugin scheint trotz lokalem deploy nicht gefunden zu werden.

robbatt commented 8 years ago

Mit dependency: classpath 'ch.raffael.pegdown-doclet:pegdown-doclet:1.3-SNAPSHOT' bekomme ich:

Error:Could not find ch.raffael.pegdown-doclet:pegdown-doclet:1.3-SNAPSHOT.
Searched in the following locations:
    file:/C:/Users/rbr/.m2/repository/ch/raffael/pegdown-doclet/pegdown-doclet/1.3-SNAPSHOT/maven-metadata.xml
    file:/C:/Users/rbr/.m2/repository/ch/raffael/pegdown-doclet/pegdown-doclet/1.3-SNAPSHOT/pegdown-doclet-1.3-SNAPSHOT.pom
    file:/C:/Users/rbr/.m2/repository/ch/raffael/pegdown-doclet/pegdown-doclet/1.3-SNAPSHOT/pegdown-doclet-1.3-SNAPSHOT.jar
    https://jcenter.bintray.com/ch/raffael/pegdown-doclet/pegdown-doclet/1.3-SNAPSHOT/maven-metadata.xml
    https://jcenter.bintray.com/ch/raffael/pegdown-doclet/pegdown-doclet/1.3-SNAPSHOT/pegdown-doclet-1.3-SNAPSHOT.pom
    https://jcenter.bintray.com/ch/raffael/pegdown-doclet/pegdown-doclet/1.3-SNAPSHOT/pegdown-doclet-1.3-SNAPSHOT.jar
Required by:
    :HMD:unspecified
robbatt commented 8 years ago

mit publishToMavenLocal via 'maven-publish' plugin landen die Artefakte in .m2/repository/ch/raffael/pegdown-doclet/gradle-plugin/1.3-SNAPSHOT also müsste die dependency so heißen: classpath 'ch.raffael.pegdown-doclet:gradle-plugin:1.3-SNAPSHOT'

dann kommt aber das nächste Problem

Error:(2, 0) Plugin with id 'pegdown-doclet' not found.
robbatt commented 8 years ago

ich habe den statischen String im gradle plugin, der dem User-Projekt eine dependency hinzufügt geändert von compile 'ch.raffael.pegdown-doclet:pegdown-doclet:$version' auf compile 'ch.raffael.pegdown-doclet:gradle-plugin:$version' das sollte das Artefakt dort suchen wo es hin generiert wird.

robbatt commented 8 years ago

Außerdem sollte die Doku angepasst werden. Es muss heißen: apply plugin: 'ch.raffael.pegdown-doclet statt nur apply plugin: 'pegdown-doclet' optional könnte man aber auch eine resources/META-INF/gradle-plugins/pegdown-doclet.properties ablegen, dann würde es mit der kurzen Variante funktionieren.

robbatt commented 8 years ago

nächster Fehler

Caused by: java.util.zip.ZipException: invalid code lengths set
    at ch.raffael.doclets.pegdown.integrations.gradle.PegdownDocletPlugin$_apply_closure1.doCall(PegdownDocletPlugin.groovy:19)
    at ch.raffael.doclets.pegdown.integrations.gradle.PegdownDocletPlugin.apply(PegdownDocletPlugin.groovy:18)
    at ch.raffael.doclets.pegdown.integrations.gradle.PegdownDocletPlugin.apply(PegdownDocletPlugin.groovy)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
    at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:44)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
    ... 71 more

scheint ein Problem beim Auslesen der version.txt

robbatt commented 8 years ago

Änderung des Lesens der Datei zu PegdownDocletPlugin.class.getResourceAsStream('version.txt').text.trim() bringt mich zu folgendem Fehler

Caused by: java.util.zip.ZipException: invalid stored block lengths
    at ch.raffael.doclets.pegdown.integrations.gradle.PegdownDocletPlugin.apply(PegdownDocletPlugin.groovy:18)
    at ch.raffael.doclets.pegdown.integrations.gradle.PegdownDocletPlugin.apply(PegdownDocletPlugin.groovy)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
    at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:44)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
    ... 71 more

scheint ein encoding problem beim entpacken von version.txt aus dem .jar

robbatt commented 8 years ago

Gerade nochmal drüber nachgedacht. Aktuell fügt das gradle plugin eine configuration mit dependency zum eigentlichen Doclet hinzu und ändert options aller JavaDoc Tasks (meine Änderung des static dependency strings zu 'gradle-plugin' ist an der Stelle falsch).

  1. Da immer die selbe Version, die auch das gradle plugin hat, als dependency hinzugefügt wird, macht es nicht Sinn das Doclet ins plugin jar zu packen und einen eigenen Task bereit zu stellen? Dann würde auch diese versteckte dynamische Dependency und der Fehler mit dem version.txt auslesen wegfallen, da immer die richtigen Klassen mitgeliefert werden.
  2. Custom JavaDoc Tasks (so wie wir einen im Projekt haben, mit eigenen options) würden überschrieben, was manuell mit dependsOn geregelt werden müsste. Das ist nicht gerade intuitiv.
Abnaxos commented 8 years ago

456f650 should solve the problem just fine. :)