diff options
author | Simon Ogorodnik <sem-oro@yandex.ru> | 2016-12-08 15:13:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-08 15:13:06 +0300 |
commit | 25b9aa91139063e977a06aec0b3f1b30f05a172a (patch) | |
tree | fd6f469167acf6ac8efef1b187c9d1067a3dad74 /runners/maven-plugin | |
parent | 3d3f3596ed83448a6e80c14e5ca7117900587b7f (diff) | |
download | dokka-25b9aa91139063e977a06aec0b3f1b30f05a172a.tar.gz dokka-25b9aa91139063e977a06aec0b3f1b30f05a172a.tar.bz2 dokka-25b9aa91139063e977a06aec0b3f1b30f05a172a.zip |
tools.jar (#125), Fixes #85, #58
Added hack to adjust publishing pom for maven
Added hack to load tools.jar for cli
Diffstat (limited to 'runners/maven-plugin')
-rw-r--r-- | runners/maven-plugin/build.gradle | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/runners/maven-plugin/build.gradle b/runners/maven-plugin/build.gradle index d73126f4..bf6b9476 100644 --- a/runners/maven-plugin/build.gradle +++ b/runners/maven-plugin/build.gradle @@ -1,5 +1,7 @@ +import groovy.xml.QName import org.jetbrains.CrossPlatformExec + apply plugin: 'kotlin' apply plugin: 'com.github.johnrengelman.shadow' @@ -52,8 +54,6 @@ pluginDescriptor.dependsOn generatePom shadowJar { baseName = 'dokka-maven-plugin' classifier = '' - - relocate('kotlin.', 'dokkakotlin.') } shadowJar.dependsOn pluginDescriptor @@ -74,8 +74,62 @@ publishing { artifact sourceJar { classifier "sources" } + + pom.withXml { + Node root = asNode() + + def dependency = new XmlParser().parseText(''' + <dependency> + <groupId>com.sun</groupId> + <artifactId>tools</artifactId> + <version>1.8.0</version> + <scope>system</scope> + <systemPath>${toolsjar}</systemPath> + </dependency> + ''') + + root.children().find { + return ((QName) it.name()).qualifiedName == "dependencies" + }.append(dependency) + + def profiles = new XmlParser().parseText(''' + <profiles> + <profile> + <id>default-profile</id> + <activation> + <activeByDefault>true</activeByDefault> + <file> + <exists>${java.home}/../lib/tools.jar</exists> + </file> + </activation> + <properties> + <toolsjar>${java.home}/../lib/tools.jar</toolsjar> + </properties> + </profile> + <profile> + <id>mac-profile</id> + <activation> + <activeByDefault>false</activeByDefault> + <file> + <exists>${java.home}/../Classes/classes.jar</exists> + </file> + </activation> + <properties> + <toolsjar>${java.home}/../Classes/classes.jar</toolsjar> + </properties> + </profile> + </profiles> + ''') + root.append(profiles) + } } } } +tasks.withType(GenerateMavenPom) { Task generatePom -> + generatePom.doLast { + + } +} + bintrayPublication(project, ['dokkaMavenPlugin'])
\ No newline at end of file |