mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Merge branch 'master' of https://github.com/cbeust/kobalt
This commit is contained in:
commit
4b17dade8e
52 changed files with 1022 additions and 607 deletions
|
@ -12,9 +12,9 @@
|
|||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.jetbrains.kotlin:kotlin-runtime:jar:1.0.0">
|
||||
<library name="Kobalt: org.jetbrains.kotlin:kotlin-runtime:jar:1.0.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/jetbrains/kotlin/kotlin-runtime/1.0.0/kotlin-runtime-1.0.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/jetbrains/kotlin/kotlin-runtime/1.0.2/kotlin-runtime-1.0.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -23,7 +23,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-api:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-api/1.1.0/aether-api-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-api/1.1.0/aether-api-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -32,7 +32,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.google.inject:guice:jar:4.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/google/inject/guice/4.0/guice-4.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/google/inject/guice/4.0/guice-4.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -41,7 +41,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-6">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -50,7 +50,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.aether:aether-spi:jar:1.13.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/aether/aether-spi/1.13.1/aether-spi-1.13.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/aether/aether-spi/1.13.1/aether-spi-1.13.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -59,7 +59,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.codehaus.plexus:plexus-component-annotations:jar:1.6">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -68,7 +68,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.google.guava:guava:jar:19.0-rc2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/google/guava/guava/19.0-rc2/guava-19.0-rc2.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/google/guava/guava/19.0-rc2/guava-19.0-rc2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -77,7 +77,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.squareup.retrofit2:converter-gson:jar:2.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/squareup/retrofit2/converter-gson/2.0.0/converter-gson-2.0.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/squareup/retrofit2/converter-gson/2.0.0/converter-gson-2.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -86,7 +86,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven:maven-aether-provider:jar:3.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/maven-aether-provider/3.3.9/maven-aether-provider-3.3.9.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/maven-aether-provider/3.3.9/maven-aether-provider-3.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -95,7 +95,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.sisu:sisu-inject-bean:jar:2.2.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/sisu/sisu-inject-bean/2.2.3/sisu-inject-bean-2.2.3.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/sisu/sisu-inject-bean/2.2.3/sisu-inject-bean-2.2.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -104,7 +104,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.slf4j:jcl-over-slf4j:jar:1.6.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/slf4j/jcl-over-slf4j/1.6.2/jcl-over-slf4j-1.6.2.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/slf4j/jcl-over-slf4j/1.6.2/jcl-over-slf4j-1.6.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -113,7 +113,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: io.reactivex:rxjava:jar:1.0.16">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/io/reactivex/rxjava/1.0.16/rxjava-1.0.16.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/io/reactivex/rxjava/1.0.16/rxjava-1.0.16.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -122,7 +122,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.aether:aether-api:jar:1.13.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/aether/aether-api/1.13.1/aether-api-1.13.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/aether/aether-api/1.13.1/aether-api-1.13.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -131,7 +131,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven:maven-model-builder:jar:3.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/maven-model-builder/3.3.9/maven-model-builder-3.3.9.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/maven-model-builder/3.3.9/maven-model-builder-3.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -140,7 +140,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven:maven-model:jar:3.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/maven-model/3.3.9/maven-model-3.3.9.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/maven-model/3.3.9/maven-model-3.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -149,7 +149,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-spi:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-spi/1.1.0/aether-spi-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-spi/1.1.0/aether-spi-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -158,7 +158,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: javax.inject:javax.inject:jar:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/javax/inject/javax.inject/1/javax.inject-1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/javax/inject/javax.inject/1/javax.inject-1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -167,7 +167,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.codehaus.plexus:plexus-classworlds:jar:2.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/codehaus/plexus/plexus-classworlds/2.4/plexus-classworlds-2.4.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/codehaus/plexus/plexus-classworlds/2.4/plexus-classworlds-2.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -176,7 +176,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.squareup.okhttp3:okhttp:jar:3.2.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/squareup/okhttp3/okhttp/3.2.0/okhttp-3.2.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/squareup/okhttp3/okhttp/3.2.0/okhttp-3.2.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -185,7 +185,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven:maven-repository-metadata:jar:3.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/maven-repository-metadata/3.3.9/maven-repository-metadata-3.3.9.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/maven-repository-metadata/3.3.9/maven-repository-metadata-3.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -194,7 +194,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.aether:aether-connector-wagon:jar:1.13.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/aether/aether-connector-wagon/1.13.1/aether-connector-wagon-1.13.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/aether/aether-connector-wagon/1.13.1/aether-connector-wagon-1.13.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -203,7 +203,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.slf4j:slf4j-nop:jar:1.6.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/slf4j/slf4j-nop/1.6.0/slf4j-nop-1.6.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/slf4j/slf4j-nop/1.6.0/slf4j-nop-1.6.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -212,7 +212,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-transport-http:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-transport-http/1.1.0/aether-transport-http-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-transport-http/1.1.0/aether-transport-http-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -221,7 +221,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.httpcomponents:httpclient:jar:4.3.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -230,7 +230,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-transport-file:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-transport-file/1.1.0/aether-transport-file-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-transport-file/1.1.0/aether-transport-file-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -239,7 +239,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.aether:aether-util:jar:1.13.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -248,7 +248,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven:maven-artifact:jar:3.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -257,7 +257,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.sisu:sisu-guice:jar:no_aop:3.0.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/sisu/sisu-guice/3.0.3/sisu-guice-3.0.3-no_aop.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/sisu/sisu-guice/3.0.3/sisu-guice-3.0.3-no_aop.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -266,7 +266,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.beust:jcommander:jar:1.48">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/beust/jcommander/1.48/jcommander-1.48.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/beust/jcommander/1.48/jcommander-1.48.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -275,7 +275,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.maven:maven-builder-support:jar:3.3.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/maven/maven-builder-support/3.3.9/maven-builder-support-3.3.9.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/maven/maven-builder-support/3.3.9/maven-builder-support-3.3.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -284,7 +284,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.squareup.retrofit2:retrofit:jar:2.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/squareup/retrofit2/retrofit/2.0.0/retrofit-2.0.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/squareup/retrofit2/retrofit/2.0.0/retrofit-2.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -293,7 +293,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.codehaus.plexus:plexus-utils:jar:3.0.22">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -302,7 +302,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.httpcomponents:httpcore:jar:4.3.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -311,7 +311,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.apache.commons:commons-lang3:jar:3.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -320,7 +320,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.slf4j:slf4j-api:jar:1.6.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -329,7 +329,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.google.code.gson:gson:jar:2.6.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -338,7 +338,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-connector-basic:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-connector-basic/1.1.0/aether-connector-basic-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-connector-basic/1.1.0/aether-connector-basic-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -347,7 +347,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-util:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-util/1.1.0/aether-util-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-util/1.1.0/aether-util-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -356,7 +356,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.codehaus.plexus:plexus-interpolation:jar:1.21">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -365,7 +365,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.eclipse.aether:aether-impl:jar:1.1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/eclipse/aether/aether-impl/1.1.0/aether-impl-1.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/eclipse/aether/aether-impl/1.1.0/aether-impl-1.1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -374,7 +374,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.squareup.okio:okio:jar:1.6.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -383,16 +383,16 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.sonatype.sisu:sisu-inject-plexus:jar:2.2.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/sonatype/sisu/sisu-inject-plexus/2.2.3/sisu-inject-plexus-2.2.3.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/sonatype/sisu/sisu-inject-plexus/2.2.3/sisu-inject-plexus-2.2.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.jetbrains.kotlin:kotlin-stdlib:jar:1.0.0">
|
||||
<library name="Kobalt: org.jetbrains.kotlin:kotlin-stdlib:jar:1.0.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/jetbrains/kotlin/kotlin-stdlib/1.0.0/kotlin-stdlib-1.0.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/jetbrains/kotlin/kotlin-stdlib/1.0.2/kotlin-stdlib-1.0.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -401,7 +401,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: commons-logging:commons-logging:jar:1.1.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -410,7 +410,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: org.jetbrains.kotlinx:kotlinx.dom:jar:0.0.10">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/org/jetbrains/kotlinx/kotlinx.dom/0.0.10/kotlinx.dom-0.0.10.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/org/jetbrains/kotlinx/kotlinx.dom/0.0.10/kotlinx.dom-0.0.10.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -419,7 +419,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.google.inject.extensions:guice-assistedinject:jar:4.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/com/google/inject/extensions/guice-assistedinject/4.0/guice-assistedinject-4.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/com/google/inject/extensions/guice-assistedinject/4.0/guice-assistedinject-4.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -428,7 +428,7 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: aopalliance:aopalliance:jar:1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -437,11 +437,12 @@
|
|||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: commons-codec:commons-codec:jar:1.6">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.m2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.kobalt/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="kobalt.jar" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
</module>
|
||||
|
|
|
@ -45,6 +45,10 @@ class Args {
|
|||
@Parameter(names = arrayOf("--log"), description = "Define the log level (1-3)")
|
||||
var log: Int = 1
|
||||
|
||||
@Parameter(names = arrayOf("--forceIncremental"),
|
||||
description = "Force the build to be incremental even if the build file was modified")
|
||||
var forceIncremental: Boolean = false
|
||||
|
||||
@Parameter(names = arrayOf("--noIncremental"), description = "Turn off incremental builds")
|
||||
var noIncremental: Boolean = false
|
||||
|
||||
|
|
|
@ -2,10 +2,8 @@ package com.beust.kobalt
|
|||
|
||||
import com.beust.kobalt.api.KobaltContext
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.api.ProjectDescription
|
||||
import com.beust.kobalt.archive.Archives
|
||||
import com.beust.kobalt.archive.Jar
|
||||
import com.beust.kobalt.internal.JvmCompilerPlugin
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.misc.*
|
||||
import com.google.inject.Inject
|
||||
|
@ -93,26 +91,23 @@ class JarGenerator @Inject constructor(val dependencyManager: DependencyManager)
|
|||
// If fatJar is true, add all the transitive dependencies as well: compile, runtime and dependent projects
|
||||
//
|
||||
if (jar.fatJar) {
|
||||
log(2, "Creating fat jar")
|
||||
log(2, "Finding included files for fat jar")
|
||||
|
||||
val seen = hashSetOf<String>()
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val dependentProjects = project.projectProperties.get(JvmCompilerPlugin.DEPENDENT_PROJECTS)
|
||||
as List<ProjectDescription>
|
||||
val allDependencies = project.compileDependencies + project.compileRuntimeDependencies +
|
||||
context.variant.buildType.compileDependencies +
|
||||
context.variant.buildType.compileRuntimeDependencies +
|
||||
context.variant.productFlavor.compileDependencies +
|
||||
context.variant.productFlavor.compileRuntimeDependencies
|
||||
val transitiveDependencies = dependencyManager.calculateDependencies(project, context, dependentProjects,
|
||||
allDependencies)
|
||||
val transitiveDependencies = dependencyManager.calculateDependencies(project, context, allDependencies)
|
||||
transitiveDependencies.map {
|
||||
it.jarFile.get()
|
||||
}.forEach { file : File ->
|
||||
if (! seen.contains(file.path)) {
|
||||
seen.add(file.path)
|
||||
if (! KFiles.Companion.isExcluded(file, jar.excludes)) {
|
||||
result.add(IncludedFile(specs = arrayListOf(IFileSpec.FileSpec(file.path)),
|
||||
result.add(IncludedFile(specs = arrayListOf(IFileSpec.FileSpec(file.absolutePath)),
|
||||
expandJarFiles = true))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.beust.kobalt.misc.KFiles
|
|||
import com.beust.kobalt.misc.KobaltExecutors
|
||||
import com.beust.kobalt.misc.log
|
||||
import com.google.inject.Provider
|
||||
import java.io.File
|
||||
import java.lang.reflect.Method
|
||||
import java.lang.reflect.Modifier
|
||||
import java.net.URLClassLoader
|
||||
|
@ -78,7 +79,9 @@ class Plugins @Inject constructor (val taskManagerProvider : Provider<TaskManage
|
|||
|
||||
// Collect all the tasks from the task contributors
|
||||
context.pluginInfo.taskContributors.forEach {
|
||||
taskManager.dynamicTasks.addAll(it.tasksFor(context))
|
||||
projects.forEach { project ->
|
||||
taskManager.dynamicTasks.addAll(it.tasksFor(project, context))
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we have collected all static and dynamic tasks, turn them all into plug-in tasks
|
||||
|
@ -160,9 +163,17 @@ class Plugins @Inject constructor (val taskManagerProvider : Provider<TaskManage
|
|||
//
|
||||
// Open the jar, parse its kobalt-plugin.xml and add the resulting PluginInfo to pluginInfo
|
||||
//
|
||||
val pluginXml = JarUtils.extractTextFile(JarFile(it.jarFile.get()), PluginInfo.PLUGIN_XML)
|
||||
val file = it.jarFile.get()
|
||||
val pluginXml = if (file.isDirectory) {
|
||||
// The plug-in can point to a directory (e.g. plugin("classes")), in which case we just
|
||||
// read kobalt-plugin.xml directly
|
||||
File(file, PluginInfo.PLUGIN_XML).readText()
|
||||
} else {
|
||||
// The plug-in is pointing to a jar file, read kobalt-plugin.xml from it
|
||||
JarUtils.extractTextFile(JarFile(file), PluginInfo.PLUGIN_XML)
|
||||
}
|
||||
if (pluginXml != null) {
|
||||
val pluginClassLoader = URLClassLoader(arrayOf(it.jarFile.get().toURI().toURL()))
|
||||
val pluginClassLoader = URLClassLoader(arrayOf(file.toURI().toURL()))
|
||||
val thisPluginInfo = PluginInfo.readPluginXml(pluginXml, pluginClassLoader, scriptClassLoader)
|
||||
pluginInfo.addPluginInfo(thisPluginInfo)
|
||||
thisPluginInfo.plugins.forEach {
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.beust.kobalt.api
|
|||
/**
|
||||
* Plug-ins can alter the build directory by implementing this interface.
|
||||
*/
|
||||
interface IBuildDirectoryIncerceptor : IInterceptor {
|
||||
interface IBuildDirectoryInterceptor : IInterceptor {
|
||||
fun intercept(project: Project, context: KobaltContext, buildDirectory: String) : String
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,5 @@ interface IDependencyManager {
|
|||
* allDependencies is typically either compileDependencies or testDependencies
|
||||
*/
|
||||
fun calculateDependencies(project: Project?, context: KobaltContext,
|
||||
dependentProjects: List<ProjectDescription> = emptyList(),
|
||||
vararg allDependencies: List<IClasspathDependency>): List<IClasspathDependency>
|
||||
}
|
|
@ -5,7 +5,7 @@ import java.io.File
|
|||
/**
|
||||
* Plug-ins can alter the source directories by implementing this interface.
|
||||
*/
|
||||
interface ISourceDirectoryIncerceptor : IInterceptor {
|
||||
interface ISourceDirectoryInterceptor : IInterceptor {
|
||||
fun intercept(project: Project, context: KobaltContext, sourceDirectories: List<File>) : List<File>
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.beust.kobalt.internal.TaskResult2
|
|||
* to implement this interface.
|
||||
*/
|
||||
interface ITaskContributor : IContributor {
|
||||
fun tasksFor(context: KobaltContext) : List<DynamicTask>
|
||||
fun tasksFor(project: Project, context: KobaltContext) : List<DynamicTask>
|
||||
}
|
||||
|
||||
class DynamicTask(override val plugin: IPlugin, override val name: String, override val doc: String,
|
||||
|
|
|
@ -123,6 +123,8 @@ open class Project(
|
|||
})
|
||||
return result
|
||||
}
|
||||
|
||||
override fun toString() = "[Project $name]"
|
||||
}
|
||||
|
||||
class Sources(val project: Project, val sources: HashSet<String>) {
|
||||
|
|
|
@ -53,6 +53,7 @@ class TaskContributor @Inject constructor(val incrementalManagerFactory: Increme
|
|||
runTask: (Project) -> IncrementalTaskInfo) {
|
||||
Variant.allVariants(project).forEach { variant ->
|
||||
val variantTaskName = variant.toTask(taskName)
|
||||
context.variant = variant
|
||||
dynamicTasks.add(DynamicTask(plugin, variantTaskName, variantTaskName, group, project,
|
||||
dependsOn = dependsOn.map { variant.toTask(it) },
|
||||
reverseDependsOn = reverseDependsOn.map { variant.toTask(it) },
|
||||
|
@ -62,5 +63,5 @@ class TaskContributor @Inject constructor(val incrementalManagerFactory: Increme
|
|||
}
|
||||
}
|
||||
|
||||
override fun tasksFor(context: KobaltContext) : List<DynamicTask> = dynamicTasks
|
||||
override fun tasksFor(project: Project, context: KobaltContext) : List<DynamicTask> = dynamicTasks
|
||||
}
|
||||
|
|
|
@ -33,12 +33,19 @@ class Archives {
|
|||
val result = File(archiveDir.path, fullArchiveName)
|
||||
log(3, "Creating $result")
|
||||
if (! Features.USE_TIMESTAMPS || isOutdated(project.directory, includedFiles, result)) {
|
||||
val outStream = outputStreamFactory(FileOutputStream(result))
|
||||
JarUtils.addFiles(project.directory, includedFiles, outStream, expandJarFiles)
|
||||
log(2, text = "Added ${includedFiles.size} files to $result")
|
||||
outStream.flush()
|
||||
outStream.close()
|
||||
log(1, " Created $result")
|
||||
try {
|
||||
outputStreamFactory(FileOutputStream(result)).use {
|
||||
JarUtils.addFiles(project.directory, includedFiles, it, expandJarFiles)
|
||||
log(2, text = "Added ${includedFiles.size} files to $result")
|
||||
log(1, " Created $result")
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
// make sure that incomplete archive is deleted
|
||||
// otherwise incremental build does not work on next run
|
||||
result.delete()
|
||||
throw e
|
||||
}
|
||||
|
||||
} else {
|
||||
log(3, " $result is up to date")
|
||||
}
|
||||
|
|
|
@ -0,0 +1,192 @@
|
|||
package com.beust.kobalt.internal
|
||||
|
||||
import com.beust.kobalt.TaskResult
|
||||
import com.beust.kobalt.api.*
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.beust.kobalt.maven.dependency.FileDependency
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.log
|
||||
import com.google.inject.Inject
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Central place to compile files, used by plug-ins and non plug-ins.
|
||||
*/
|
||||
class CompilerUtils @Inject constructor(val files: KFiles,
|
||||
val dependencyManager: DependencyManager) {
|
||||
|
||||
class CompilerResult(val successResults: List<TaskResult>, val failedResult: TaskResult?)
|
||||
|
||||
fun invokeCompiler(project: Project, context: KobaltContext, compiler: ICompiler,
|
||||
sourceDirectories: List<File>, isTest: Boolean): CompilerResult {
|
||||
val results = arrayListOf<TaskResult>()
|
||||
var failedResult: TaskResult? = null
|
||||
val contributedSourceDirs =
|
||||
if (isTest) {
|
||||
context.testSourceDirectories(project)
|
||||
} else {
|
||||
context.sourceDirectories(project)
|
||||
}
|
||||
val sourceFiles = KFiles.findSourceFiles(project.directory,
|
||||
contributedSourceDirs.map { it.path }, compiler.sourceSuffixes)
|
||||
if (sourceFiles.size > 0) {
|
||||
// TODO: createCompilerActionInfo recalculates the source files, only compute them
|
||||
// once and pass them
|
||||
val info = createCompilerActionInfo(project, context, compiler, isTest,
|
||||
sourceDirectories, sourceSuffixes = compiler.sourceSuffixes)
|
||||
val thisResult = invokeCompiler(project, context, compiler, info)
|
||||
results.addAll(thisResult.successResults)
|
||||
if (failedResult == null) {
|
||||
failedResult = thisResult.failedResult
|
||||
}
|
||||
} else {
|
||||
log(2, "Compiler $compiler not running on ${project.name} since no source files were found")
|
||||
}
|
||||
|
||||
return CompilerResult(results, failedResult)
|
||||
}
|
||||
|
||||
fun invokeCompiler(project: Project, context: KobaltContext, compiler: ICompiler, info: CompilerActionInfo)
|
||||
: CompilerResult {
|
||||
val results = arrayListOf<TaskResult>()
|
||||
var failedResult: TaskResult? = null
|
||||
val thisResult = compiler.compile(project, context, info)
|
||||
results.add(thisResult)
|
||||
if (!thisResult.success && failedResult == null) {
|
||||
failedResult = thisResult
|
||||
}
|
||||
return CompilerResult(results, failedResult)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a CompilerActionInfo (all the information that a compiler needs to know) for the given parameters.
|
||||
* Runs all the contributors and interceptors relevant to that task.
|
||||
*/
|
||||
fun createCompilerActionInfo(project: Project, context: KobaltContext, compiler: ICompiler,
|
||||
isTest: Boolean, sourceDirectories: List<File>, sourceSuffixes: List<String>): CompilerActionInfo {
|
||||
copyResources(project, context, SourceSet.of(isTest))
|
||||
|
||||
val fullClasspath = if (isTest) dependencyManager.testDependencies(project, context)
|
||||
else dependencyManager.dependencies(project, context)
|
||||
|
||||
// The directory where the classes get compiled
|
||||
val buildDirectory = if (isTest) File(project.buildDirectory, KFiles.TEST_CLASSES_DIR)
|
||||
else File(project.classesDir(context))
|
||||
File(project.directory, buildDirectory.path).mkdirs()
|
||||
|
||||
// Remove all the excluded dependencies from the classpath
|
||||
var classpath = fullClasspath.filter {
|
||||
! isDependencyExcluded(it, project.excludedDependencies)
|
||||
}
|
||||
|
||||
// The classpath needs to contain $buildDirectory/classes as well so that projects that contain
|
||||
// multiple languages can use classes compiled by the compiler run before them.
|
||||
if (buildDirectory.exists()) {
|
||||
classpath += FileDependency(buildDirectory.path)
|
||||
}
|
||||
|
||||
val initialSourceDirectories = ArrayList<File>(sourceDirectories)
|
||||
// Source directories from the contributors
|
||||
val contributedSourceDirs =
|
||||
if (isTest) {
|
||||
context.pluginInfo.testSourceDirContributors.flatMap { it.testSourceDirectoriesFor(project, context) }
|
||||
} else {
|
||||
context.pluginInfo.sourceDirContributors.flatMap { it.sourceDirectoriesFor(project, context) }
|
||||
}
|
||||
|
||||
initialSourceDirectories.addAll(contributedSourceDirs)
|
||||
|
||||
// Transform them with the interceptors, if any
|
||||
val allSourceDirectories =
|
||||
if (isTest) {
|
||||
initialSourceDirectories
|
||||
} else {
|
||||
context.pluginInfo.sourceDirectoriesInterceptors.fold(initialSourceDirectories.toList(),
|
||||
{ sd, interceptor -> interceptor.intercept(project, context, sd) })
|
||||
}.filter {
|
||||
File(project.directory, it.path).exists()
|
||||
}.filter {
|
||||
! KFiles.isResource(it.path)
|
||||
}.distinct()
|
||||
|
||||
// Now that we have all the source directories, find all the source files in them
|
||||
val projectDirectory = File(project.directory)
|
||||
val sourceFiles = if (compiler.canCompileDirectories) {
|
||||
allSourceDirectories.map { File(projectDirectory, it.path).path }
|
||||
} else {
|
||||
files.findRecursively(projectDirectory, allSourceDirectories,
|
||||
{ file -> sourceSuffixes.any { file.endsWith(it) } })
|
||||
.map { File(projectDirectory, it).path }
|
||||
}
|
||||
|
||||
// Special treatment if we are compiling Kotlin files and the project also has a java source
|
||||
// directory. In this case, also pass that java source directory to the Kotlin compiler as is
|
||||
// so that it can parse its symbols
|
||||
// Note: this should actually be queried on the compiler object so that this method, which
|
||||
// is compiler agnostic, doesn't hardcode Kotlin specific stuff
|
||||
val extraSourceFiles = arrayListOf<String>()
|
||||
if (sourceSuffixes.any { it.contains("kt")}) {
|
||||
project.sourceDirectories.forEach {
|
||||
val javaDir = KFiles.joinDir(project.directory, it)
|
||||
if (File(javaDir).exists()) {
|
||||
if (it.contains("java")) {
|
||||
extraSourceFiles.add(javaDir)
|
||||
// Add all the source directories contributed as potential Java directories too
|
||||
// (except our own)
|
||||
context.pluginInfo.sourceDirContributors
|
||||
// .filter { it != this }
|
||||
.forEach {
|
||||
extraSourceFiles.addAll(it.sourceDirectoriesFor(project, context).map { it.path })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val allSources = (sourceFiles + extraSourceFiles)
|
||||
.map { File(it).canonicalPath }
|
||||
.distinct()
|
||||
.filter { File(it).exists() }
|
||||
|
||||
// Finally, alter the info with the compiler interceptors before returning it
|
||||
val initialActionInfo = CompilerActionInfo(projectDirectory.path, classpath, allSources,
|
||||
sourceSuffixes, buildDirectory, emptyList() /* the flags will be provided by flag contributors */)
|
||||
val result = context.pluginInfo.compilerInterceptors.fold(initialActionInfo, { ai, interceptor ->
|
||||
interceptor.intercept(project, context, ai)
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the resources from a source directory to the build one
|
||||
*/
|
||||
private fun copyResources(project: Project, context: KobaltContext, sourceSet: SourceSet) {
|
||||
val outputDir = sourceSet.outputDir
|
||||
|
||||
val variantSourceDirs = context.variant.resourceDirectories(project, sourceSet)
|
||||
if (variantSourceDirs.size > 0) {
|
||||
JvmCompilerPlugin.lp(project, "Copying $sourceSet resources")
|
||||
val absOutputDir = File(KFiles.joinDir(project.directory, project.buildDirectory, outputDir))
|
||||
variantSourceDirs.map { File(project.directory, it.path) }.filter {
|
||||
it.exists()
|
||||
}.forEach {
|
||||
log(2, "Copying from $it to $absOutputDir")
|
||||
KFiles.copyRecursively(it, absOutputDir, deleteFirst = false)
|
||||
}
|
||||
} else {
|
||||
JvmCompilerPlugin.lp(project, "No resources to copy for $sourceSet")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Naïve implementation: just exclude all dependencies that start with one of the excluded dependencies.
|
||||
* Should probably make exclusion more generic (full on string) or allow exclusion to be specified
|
||||
* formally by groupId or artifactId.
|
||||
*/
|
||||
private fun isDependencyExcluded(id: IClasspathDependency, excluded: List<IClasspathDependency>)
|
||||
= excluded.any { id.id.startsWith(it.id) }
|
||||
|
||||
}
|
|
@ -19,16 +19,17 @@ import java.nio.file.Files
|
|||
import java.nio.file.Paths
|
||||
import java.util.*
|
||||
|
||||
data class TaskInfo(val taskName: String, var inputChecksum: String? = null, var outputChecksum: String? = null)
|
||||
|
||||
class BuildInfo(var tasks: List<TaskInfo>)
|
||||
|
||||
/**
|
||||
* Manage the file .kobalt/buildInfo.json, which keeps track of input and output checksums to manage
|
||||
* incremental builds.
|
||||
*/
|
||||
class IncrementalManager @Inject constructor(val args: Args, @Assisted val fileName : String) {
|
||||
|
||||
private data class TaskInfo(val taskName: String, var inputChecksum: String? = null,
|
||||
var outputChecksum: String? = null)
|
||||
|
||||
private class BuildInfo(var tasks: List<TaskInfo>)
|
||||
|
||||
interface IFactory {
|
||||
fun create(@Assisted fileName: String = IncrementalManager.BUILD_INFO_FILE) : IncrementalManager
|
||||
}
|
||||
|
@ -79,6 +80,7 @@ class IncrementalManager @Inject constructor(val args: Args, @Assisted val fileN
|
|||
|
||||
fun outputChecksumFor(taskName: String) : String? =
|
||||
taskInfoFor(taskInfos(), taskName).outputChecksum
|
||||
|
||||
/**
|
||||
* @param method is assumed to return an IncrementalTaskInfo.
|
||||
* @return a closure that invokes that method and decide whether to run the task or not based
|
||||
|
@ -93,7 +95,8 @@ class IncrementalManager @Inject constructor(val args: Args, @Assisted val fileN
|
|||
var upToDate = false
|
||||
var taskOutputChecksum : String? = null
|
||||
|
||||
if (args.noIncremental || (Kobalt.context?.internalContext?.buildFileOutOfDate as Boolean)) {
|
||||
if (! args.forceIncremental &&
|
||||
(args.noIncremental || (Kobalt.context?.internalContext?.buildFileOutOfDate as Boolean))) {
|
||||
//
|
||||
// If the user turned off incremental builds or if the build file was modified, always run this task
|
||||
//
|
||||
|
@ -124,7 +127,8 @@ class IncrementalManager @Inject constructor(val args: Args, @Assisted val fileN
|
|||
if (outputChecksum == taskOutputChecksum) {
|
||||
upToDate = true
|
||||
} else {
|
||||
logIncremental(LEVEL, "Incremental task $taskName output is out of date, running it")
|
||||
logIncremental(LEVEL, "Incremental task $taskName output is out of date" +
|
||||
" (different output checksums), running it")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -132,7 +136,7 @@ class IncrementalManager @Inject constructor(val args: Args, @Assisted val fileN
|
|||
logIncremental(LEVEL, "Project ${project.name} depends on dirty project, running $taskName")
|
||||
} else {
|
||||
logIncremental(LEVEL, "Incremental task $taskName input is out of date, running it"
|
||||
+ " old: $inputChecksum new: ${iti.inputChecksum()}")
|
||||
+ " (different input checksums old: $inputChecksum new: ${iti.inputChecksum()})")
|
||||
}
|
||||
project.projectExtra.isDirty = true
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
open val files: KFiles,
|
||||
open val dependencyManager: DependencyManager,
|
||||
open val executors: KobaltExecutors,
|
||||
open val taskContributor : TaskContributor)
|
||||
open val taskContributor : TaskContributor,
|
||||
val compilerUtils: CompilerUtils)
|
||||
: BasePlugin(), ISourceDirectoryContributor, IProjectContributor, ITaskContributor by taskContributor {
|
||||
|
||||
companion object {
|
||||
|
@ -52,19 +53,19 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
const val GROUP_TEST = "test"
|
||||
const val GROUP_BUILD = "build"
|
||||
const val GROUP_DOCUMENTATION = "documentation"
|
||||
|
||||
/**
|
||||
* Log with a project.
|
||||
*/
|
||||
fun lp(project: Project, s: String) {
|
||||
log(2, "${project.name}: $s")
|
||||
}
|
||||
}
|
||||
|
||||
override val name: String = PLUGIN_NAME
|
||||
|
||||
override fun accept(project: Project) = true
|
||||
|
||||
/**
|
||||
* Log with a project.
|
||||
*/
|
||||
protected fun lp(project: Project, s: String) {
|
||||
log(2, "${project.name}: $s")
|
||||
}
|
||||
|
||||
override fun apply(project: Project, context: KobaltContext) {
|
||||
super.apply(project, context)
|
||||
// cleanUpActors()
|
||||
|
@ -112,41 +113,9 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
return TaskResult()
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy the resources from a source directory to the build one
|
||||
*/
|
||||
protected fun copyResources(project: Project, sourceSet: SourceSet) {
|
||||
var outputDir = sourceSet.outputDir
|
||||
|
||||
val variantSourceDirs = context.variant.resourceDirectories(project, sourceSet)
|
||||
if (variantSourceDirs.size > 0) {
|
||||
lp(project, "Copying $sourceSet resources")
|
||||
val absOutputDir = File(KFiles.joinDir(project.directory, project.buildDirectory, outputDir))
|
||||
variantSourceDirs.map { File(project.directory, it.path) }.filter {
|
||||
it.exists()
|
||||
}.forEach {
|
||||
log(2, "Copying from $it to $absOutputDir")
|
||||
KFiles.copyRecursively(it, absOutputDir, deleteFirst = false)
|
||||
}
|
||||
} else {
|
||||
lp(project, "No resources to copy for $sourceSet")
|
||||
}
|
||||
}
|
||||
|
||||
protected fun compilerArgsFor(project: Project): List<String> {
|
||||
val result = project.projectProperties.get(COMPILER_ARGS)
|
||||
if (result != null) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return result as List<String>
|
||||
} else {
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@IncrementalTask(name = TASK_COMPILE_TEST, description = "Compile the tests", group = GROUP_BUILD,
|
||||
dependsOn = arrayOf(TASK_COMPILE))
|
||||
fun taskCompileTest(project: Project): IncrementalTaskInfo {
|
||||
sourceTestDirectories.addAll(context.variant.sourceDirectories(project, context, SourceSet.of(isTest = true)))
|
||||
return IncrementalTaskInfo(
|
||||
inputChecksum = {
|
||||
Md5.toMd5Directories(context.testSourceDirectories(project).map { File(project.directory, it.path)})
|
||||
|
@ -159,12 +128,12 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
private fun sourceDirectories(project: Project, context: KobaltContext)
|
||||
= context.variant.sourceDirectories(project, context, SourceSet.of(isTest = false))
|
||||
|
||||
@IncrementalTask(name = JvmCompilerPlugin.TASK_COMPILE, description = "Compile the project", group = GROUP_BUILD,
|
||||
runAfter = arrayOf(TASK_CLEAN))
|
||||
fun taskCompile(project: Project): IncrementalTaskInfo {
|
||||
// Set up the source files now that we have the variant
|
||||
sourceDirectories.addAll(context.variant.sourceDirectories(project, context, SourceSet.of(isTest = false)))
|
||||
|
||||
return IncrementalTaskInfo(
|
||||
inputChecksum = {
|
||||
Md5.toMd5Directories(context.sourceDirectories(project).map { File(project.directory, it.path) })
|
||||
|
@ -193,29 +162,32 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
throw KobaltException("Couldn't find any compiler for project ${project.name}")
|
||||
} else {
|
||||
val allCompilers = compilerContributors.flatMap { it.compilersFor(project, context)}.sorted()
|
||||
allCompilers.forEach { compiler ->
|
||||
val contributedSourceDirs =
|
||||
if (isTest) {
|
||||
context.testSourceDirectories(project)
|
||||
} else {
|
||||
context.sourceDirectories(project)
|
||||
}
|
||||
val sourceFiles = KFiles.findSourceFiles(project.directory,
|
||||
contributedSourceDirs.map { it.path }, compiler.sourceSuffixes)
|
||||
if (sourceFiles.size > 0) {
|
||||
// TODO: createCompilerActionInfo recalculates the source files, only compute them
|
||||
// once and pass them
|
||||
val info = createCompilerActionInfo(project, context, compiler, isTest, sourceDirectories,
|
||||
sourceSuffixes = compiler.sourceSuffixes)
|
||||
val thisResult = compiler.compile(project, context, info)
|
||||
results.add(thisResult)
|
||||
if (!thisResult.success && failedResult == null) {
|
||||
failedResult = thisResult
|
||||
}
|
||||
} else {
|
||||
log(2, "Compiler $compiler not running on ${project.name} since no source files were found")
|
||||
|
||||
/**
|
||||
* Swap the Java and Kotlin compilers from the list.
|
||||
*/
|
||||
fun swapJavaAndKotlin(allCompilers: List<ICompiler>): List<ICompiler> {
|
||||
val result = ArrayList(allCompilers)
|
||||
var ik = -1
|
||||
var ij = -1
|
||||
allCompilers.withIndex().forEach { wi ->
|
||||
if (wi.value.sourceSuffixes.contains("java")) ij = wi.index
|
||||
if (wi.value.sourceSuffixes.contains("kt")) ik = wi.index
|
||||
}
|
||||
Collections.swap(result, ik, ij)
|
||||
return result
|
||||
}
|
||||
|
||||
// If this project has a kapt{} directive, we want to run the Java compiler first
|
||||
val hasKapt = project.projectProperties.get("kaptConfig") != null
|
||||
val finalAllCompilers = if (hasKapt) swapJavaAndKotlin(allCompilers) else allCompilers
|
||||
finalAllCompilers.forEach { compiler ->
|
||||
val compilerResults = compilerUtils.invokeCompiler(project, context, compiler,
|
||||
sourceDirectories(project, context), isTest)
|
||||
results.addAll(compilerResults.successResults)
|
||||
if (failedResult == null) failedResult = compilerResults.failedResult
|
||||
}
|
||||
|
||||
return if (failedResult != null) failedResult!!
|
||||
else if (results.size > 0) results[0]
|
||||
else TaskResult(true)
|
||||
|
@ -249,9 +221,9 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
var result: TaskResult? = null
|
||||
contributors.forEach {
|
||||
it.compilersFor(project, context).forEach { compiler ->
|
||||
result = docGenerator.generateDoc(project, context, createCompilerActionInfo(project, context,
|
||||
compiler,
|
||||
isTest = false, sourceDirectories = sourceDirectories,
|
||||
result = docGenerator.generateDoc(project, context,
|
||||
compilerUtils.createCompilerActionInfo(project, context, compiler,
|
||||
isTest = false, sourceDirectories = sourceDirectories(project, context),
|
||||
sourceSuffixes = compiler.sourceSuffixes))
|
||||
}
|
||||
}
|
||||
|
@ -262,110 +234,10 @@ open class JvmCompilerPlugin @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Naïve implementation: just exclude all dependencies that start with one of the excluded dependencies.
|
||||
* Should probably make exclusion more generic (full on string) or allow exclusion to be specified
|
||||
* formally by groupId or artifactId.
|
||||
*/
|
||||
private fun isDependencyExcluded(id: IClasspathDependency, excluded: List<IClasspathDependency>)
|
||||
= excluded.any { id.id.startsWith(it.id) }
|
||||
|
||||
/**
|
||||
* Create a CompilerActionInfo (all the information that a compiler needs to know) for the given parameters.
|
||||
* Runs all the contributors and interceptors relevant to that task.
|
||||
*/
|
||||
protected fun createCompilerActionInfo(project: Project, context: KobaltContext, compiler: ICompiler,
|
||||
isTest: Boolean, sourceDirectories: List<File>, sourceSuffixes: List<String>): CompilerActionInfo {
|
||||
copyResources(project, SourceSet.of(isTest))
|
||||
|
||||
val fullClasspath = if (isTest) dependencyManager.testDependencies(project, context)
|
||||
else dependencyManager.dependencies(project, context)
|
||||
|
||||
// Remove all the excluded dependencies from the classpath
|
||||
val classpath = fullClasspath.filter {
|
||||
! isDependencyExcluded(it, project.excludedDependencies)
|
||||
}
|
||||
|
||||
val buildDirectory = if (isTest) File(project.buildDirectory, KFiles.TEST_CLASSES_DIR)
|
||||
else File(project.classesDir(context))
|
||||
buildDirectory.mkdirs()
|
||||
|
||||
|
||||
val initialSourceDirectories = ArrayList<File>(sourceDirectories)
|
||||
// Source directories from the contributors
|
||||
val contributedSourceDirs =
|
||||
if (isTest) {
|
||||
context.pluginInfo.testSourceDirContributors.flatMap { it.testSourceDirectoriesFor(project, context) }
|
||||
} else {
|
||||
context.pluginInfo.sourceDirContributors.flatMap { it.sourceDirectoriesFor(project, context) }
|
||||
}
|
||||
|
||||
initialSourceDirectories.addAll(contributedSourceDirs)
|
||||
|
||||
// Transform them with the interceptors, if any
|
||||
val allSourceDirectories =
|
||||
if (isTest) {
|
||||
initialSourceDirectories
|
||||
} else {
|
||||
context.pluginInfo.sourceDirectoriesInterceptors.fold(initialSourceDirectories.toList(),
|
||||
{ sd, interceptor -> interceptor.intercept(project, context, sd) })
|
||||
}.filter {
|
||||
File(project.directory, it.path).exists()
|
||||
}.filter {
|
||||
! KFiles.isResource(it.path)
|
||||
}.distinct()
|
||||
|
||||
// Now that we have all the source directories, find all the source files in them
|
||||
val projectDirectory = File(project.directory)
|
||||
val sourceFiles = if (compiler.canCompileDirectories) {
|
||||
allSourceDirectories.map { File(projectDirectory, it.path).path }
|
||||
} else {
|
||||
files.findRecursively(projectDirectory, allSourceDirectories,
|
||||
{ file -> sourceSuffixes.any { file.endsWith(it) } })
|
||||
.map { File(projectDirectory, it).path }
|
||||
}
|
||||
|
||||
// Special treatment if we are compiling Kotlin files and the project also has a java source
|
||||
// directory. In this case, also pass that java source directory to the Kotlin compiler as is
|
||||
// so that it can parse its symbols
|
||||
// Note: this should actually be queried on the compiler object so that this method, which
|
||||
// is compiler agnostic, doesn't hardcode Kotlin specific stuff
|
||||
val extraSourceFiles = arrayListOf<String>()
|
||||
if (sourceSuffixes.any { it.contains("kt")}) {
|
||||
project.sourceDirectories.forEach {
|
||||
val javaDir = KFiles.joinDir(project.directory, it)
|
||||
if (File(javaDir).exists()) {
|
||||
if (it.contains("java")) {
|
||||
extraSourceFiles.add(javaDir)
|
||||
// Add all the source directories contributed as potential Java directories too
|
||||
// (except our own)
|
||||
context.pluginInfo.sourceDirContributors.filter { it != this }.forEach {
|
||||
extraSourceFiles.addAll(it.sourceDirectoriesFor(project, context).map { it.path })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val allSources = (sourceFiles + extraSourceFiles).distinct().filter { File(it).exists() }
|
||||
|
||||
// Finally, alter the info with the compiler interceptors before returning it
|
||||
val initialActionInfo = CompilerActionInfo(projectDirectory.path, classpath, allSources,
|
||||
sourceSuffixes, buildDirectory, emptyList() /* the flags will be provided by flag contributors */)
|
||||
val result = context.pluginInfo.compilerInterceptors.fold(initialActionInfo, { ai, interceptor ->
|
||||
interceptor.intercept(project, context, ai)
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
val sourceDirectories = arrayListOf<File>()
|
||||
val sourceTestDirectories = arrayListOf<File>()
|
||||
|
||||
// ISourceDirectoryContributor
|
||||
override fun sourceDirectoriesFor(project: Project, context: KobaltContext)
|
||||
= if (accept(project)) {
|
||||
sourceDirectories.toList()
|
||||
sourceDirectories(project, context)
|
||||
} else {
|
||||
arrayListOf()
|
||||
}
|
||||
|
|
|
@ -76,8 +76,8 @@ class PluginInfo(val xml: KobaltPluginXml, val pluginClassLoader: ClassLoader?,
|
|||
val repoContributors = arrayListOf<IRepoContributor>()
|
||||
val compilerFlagContributors = arrayListOf<ICompilerFlagContributor>()
|
||||
val compilerInterceptors = arrayListOf<ICompilerInterceptor>()
|
||||
val sourceDirectoriesInterceptors = arrayListOf<ISourceDirectoryIncerceptor>()
|
||||
val buildDirectoryInterceptors = arrayListOf<IBuildDirectoryIncerceptor>()
|
||||
val sourceDirectoriesInterceptors = arrayListOf<ISourceDirectoryInterceptor>()
|
||||
val buildDirectoryInterceptors = arrayListOf<IBuildDirectoryInterceptor>()
|
||||
val runnerContributors = arrayListOf<IRunnerContributor>()
|
||||
val testRunnerContributors = arrayListOf<ITestRunnerContributor>()
|
||||
val classpathInterceptors = arrayListOf<IClasspathInterceptor>()
|
||||
|
@ -156,10 +156,22 @@ class PluginInfo(val xml: KobaltPluginXml, val pluginClassLoader: ClassLoader?,
|
|||
GuiceFactory()
|
||||
}
|
||||
|
||||
fun forName(className: String) =
|
||||
if (pluginClassLoader != null) pluginClassLoader.loadClass(className)
|
||||
else if (classLoader != null) classLoader.loadClass(className)
|
||||
else Class.forName(className)
|
||||
fun forName(className: String) : Class<*> {
|
||||
fun loadClass(className: String, classLoader: ClassLoader?) : Class<*>? {
|
||||
try {
|
||||
return classLoader?.loadClass(className)
|
||||
} catch(ex: ClassNotFoundException) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
val result = loadClass(className, classLoader)
|
||||
?: Class.forName(className)
|
||||
?: loadClass(className, pluginClassLoader)
|
||||
?: throw ClassNotFoundException(className)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// Populate pluginInfo with what was found in Kobalt's own kobalt-plugin.xml
|
||||
|
@ -169,7 +181,7 @@ class PluginInfo(val xml: KobaltPluginXml, val pluginClassLoader: ClassLoader?,
|
|||
with(factory.instanceOf(forName(it))) {
|
||||
// Note: can't use "when" here since the same instance can implement multiple interfaces
|
||||
if (this is IBuildConfigFieldContributor) buildConfigFieldContributors.add(this)
|
||||
if (this is IBuildDirectoryIncerceptor) buildDirectoryInterceptors.add(this)
|
||||
if (this is IBuildDirectoryInterceptor) buildDirectoryInterceptors.add(this)
|
||||
if (this is IClasspathContributor) classpathContributors.add(this)
|
||||
if (this is IClasspathInterceptor) classpathInterceptors.add(this)
|
||||
if (this is ICompilerContributor) compilerContributors.add(this)
|
||||
|
@ -182,7 +194,7 @@ class PluginInfo(val xml: KobaltPluginXml, val pluginClassLoader: ClassLoader?,
|
|||
if (this is IRepoContributor) repoContributors.add(this)
|
||||
if (this is IRunnerContributor) runnerContributors.add(this)
|
||||
if (this is ISourceDirectoryContributor) sourceDirContributors.add(this)
|
||||
if (this is ISourceDirectoryIncerceptor) sourceDirectoriesInterceptors.add(this)
|
||||
if (this is ISourceDirectoryInterceptor) sourceDirectoriesInterceptors.add(this)
|
||||
if (this is ITaskContributor) taskContributors.add(this)
|
||||
if (this is ITestRunnerContributor) testRunnerContributors.add(this)
|
||||
if (this is IMavenIdInterceptor) mavenIdInterceptors.add(this)
|
||||
|
|
|
@ -27,7 +27,7 @@ class KobaltSettingsXml {
|
|||
var proxies: ProxiesXml? = null
|
||||
|
||||
@XmlElement(name = "kobalt-compiler-version") @JvmField
|
||||
var kobaltCompilerVersion: String = "1.0.0"
|
||||
var kobaltCompilerVersion: String = "1.0.2"
|
||||
|
||||
@XmlElement(name = "kobalt-compiler-repo") @JvmField
|
||||
var kobaltCompilerRepo: String? = null
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.beust.kobalt.internal
|
||||
|
||||
import com.beust.kobalt.maven.DependencyManager
|
||||
import com.google.inject.Inject
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* The jar files that Kotlin needs to run.
|
||||
*/
|
||||
class KotlinJarFiles @Inject constructor(val dependencyManager: DependencyManager,
|
||||
val settings: KobaltSettings){
|
||||
private fun getKotlinCompilerJar(name: String): File {
|
||||
val id = "org.jetbrains.kotlin:kotlin-$name:${settings.kobaltCompilerVersion}"
|
||||
val dep = dependencyManager.create(id)
|
||||
return dep.jarFile.get().absoluteFile
|
||||
}
|
||||
|
||||
val stdlib: File get() = getKotlinCompilerJar("stdlib")
|
||||
val runtime: File get() = getKotlinCompilerJar("runtime")
|
||||
val compiler: File get() = getKotlinCompilerJar("compiler-embeddable")
|
||||
}
|
|
@ -4,10 +4,7 @@ import com.beust.kobalt.*
|
|||
import com.beust.kobalt.api.*
|
||||
import com.beust.kobalt.api.annotation.IncrementalTask
|
||||
import com.beust.kobalt.api.annotation.Task
|
||||
import com.beust.kobalt.misc.Strings
|
||||
import com.beust.kobalt.misc.benchmarkMillis
|
||||
import com.beust.kobalt.misc.kobaltError
|
||||
import com.beust.kobalt.misc.log
|
||||
import com.beust.kobalt.misc.*
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import com.google.common.collect.ArrayListMultimap
|
||||
import com.google.common.collect.ListMultimap
|
||||
|
@ -81,7 +78,41 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
}
|
||||
}
|
||||
|
||||
fun runTargets(taskNames: List<String>, projects: List<Project>): RunTargetResult {
|
||||
fun runTargets(passedTaskNames: List<String>, allProjects: List<Project>): RunTargetResult {
|
||||
val taskInfos = calculateDependentTaskNames(passedTaskNames, allProjects)
|
||||
val projectsToRun = findProjectsToRun(taskInfos, allProjects)
|
||||
return runProjects(taskInfos, projectsToRun)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine which projects to run based on the request tasks. Also make sure that all the requested projects
|
||||
* exist.
|
||||
*/
|
||||
fun findProjectsToRun(taskInfos: List<TaskInfo>, projects: List<Project>) : List<Project> {
|
||||
|
||||
// Validate projects
|
||||
val result = arrayListOf<Project>()
|
||||
val projectMap = HashMap<String, Project>().apply {
|
||||
projects.forEach { put(it.name, it)}
|
||||
}
|
||||
|
||||
// Extract all the projects we need to run from the tasks
|
||||
// val orderedTaskInfos = calculateDependentTaskNames(taskInfos.map { it.id }, projects)
|
||||
taskInfos.forEach {
|
||||
val p = it.project
|
||||
if (p != null) {
|
||||
if (! projectMap.containsKey(p)) {
|
||||
throw KobaltException("Unknown project: ${it.project}")
|
||||
}
|
||||
result.add(projectMap[it.project]!!)
|
||||
}
|
||||
}
|
||||
|
||||
// If at least one task didn't specify a project, run them all
|
||||
return if (result.any()) result else projects
|
||||
}
|
||||
|
||||
private fun runProjects(taskInfos: List<TaskInfo>, projects: List<Project>) : RunTargetResult {
|
||||
var result = 0
|
||||
val failedProjects = hashSetOf<String>()
|
||||
val messages = Collections.synchronizedList(arrayListOf<String>())
|
||||
|
@ -111,7 +142,7 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
log(3, " $it: " + tasksByNames.get(it))
|
||||
}
|
||||
|
||||
val graph = createGraph2(project.name, taskNames, tasksByNames,
|
||||
val graph = createGraph2(project.name, taskInfos, tasksByNames,
|
||||
dependsOn, reverseDependsOn, runBefore, runAfter, alwaysRunAfter,
|
||||
{ task: ITask -> task.name },
|
||||
{ task: ITask -> task.plugin.accept(project) })
|
||||
|
@ -137,9 +168,65 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return RunTargetResult(result, messages)
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user wants to run a single task on a single project (e.g. "kobalt:assemble"), we need to
|
||||
* see if that project depends on others and if it does, invoke these tasks on all of them. This
|
||||
* function returns all these task names (including dependent).
|
||||
*/
|
||||
fun calculateDependentTaskNames(taskNames: List<String>, projects: List<Project>): List<TaskInfo> {
|
||||
val projectMap = hashMapOf<String, Project>().apply {
|
||||
projects.forEach { project -> put(project.name, project)}
|
||||
}
|
||||
|
||||
val allTaskInfos = HashSet(taskNames.map { TaskInfo(it) })
|
||||
with(Topological<TaskInfo>()) {
|
||||
val toProcess = ArrayList(allTaskInfos)
|
||||
val seen = HashSet(allTaskInfos)
|
||||
val newTasks = hashSetOf<TaskInfo>()
|
||||
|
||||
fun maybeAdd(taskInfo: TaskInfo) {
|
||||
if (!seen.contains(taskInfo)) {
|
||||
newTasks.add(taskInfo)
|
||||
seen.add(taskInfo)
|
||||
}
|
||||
}
|
||||
|
||||
while (toProcess.any()) {
|
||||
toProcess.forEach { ti ->
|
||||
val project = projectMap[ti.project]
|
||||
if (project != null) {
|
||||
val dependents = project.projectExtra.dependsOn
|
||||
if (dependents.any()) {
|
||||
dependents.forEach { depProject ->
|
||||
val tiDep = TaskInfo(depProject.name, ti.taskName)
|
||||
allTaskInfos.add(tiDep)
|
||||
addEdge(ti, tiDep)
|
||||
maybeAdd(tiDep)
|
||||
}
|
||||
} else {
|
||||
allTaskInfos.add(ti)
|
||||
addNode(ti)
|
||||
}
|
||||
} else {
|
||||
// No project specified for this task, run that task in all the projects
|
||||
projects.forEach {
|
||||
maybeAdd(TaskInfo(it.name, ti.taskName))
|
||||
}
|
||||
}
|
||||
}
|
||||
toProcess.clear()
|
||||
toProcess.addAll(newTasks)
|
||||
newTasks.clear()
|
||||
}
|
||||
val result = sort()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
val LOG_LEVEL = 3
|
||||
|
||||
/**
|
||||
|
@ -150,7 +237,8 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
* we'll be adding to the graph while @toName extracts the name of a node.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
fun <T> createGraph2(projectName: String, taskNames: List<String>, nodeMap: Multimap<String, T>,
|
||||
fun <T> createGraph2(projectName: String, passedTasks: List<TaskInfo>,
|
||||
nodeMap: Multimap<String, T>,
|
||||
dependsOn: Multimap<String, String>,
|
||||
reverseDependsOn: Multimap<String, String>,
|
||||
runBefore: Multimap<String, String>,
|
||||
|
@ -176,9 +264,9 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
}
|
||||
|
||||
//
|
||||
// Turn the task names into the more useful TaskInfo and do some sanity checking on the way
|
||||
// Keep only the tasks we need to run.
|
||||
//
|
||||
val taskInfos = taskNames.map { TaskInfo(it) }.filter {
|
||||
val taskInfos = passedTasks.filter {
|
||||
if (!nodeMap.keys().contains(it.taskName)) {
|
||||
throw KobaltException("Unknown task: $it")
|
||||
}
|
||||
|
@ -262,14 +350,16 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
// runBefore and runAfter (task ordering) are only considered for explicit tasks (tasks that were
|
||||
// explicitly requested by the user)
|
||||
//
|
||||
runBefore[taskName].forEach { from ->
|
||||
if (taskNames.contains(from)) {
|
||||
addEdge(result, from, taskName, newToProcess, "runBefore")
|
||||
passedTasks.map { it.id }.let { taskNames ->
|
||||
runBefore[taskName].forEach { from ->
|
||||
if (taskNames.contains(from)) {
|
||||
addEdge(result, from, taskName, newToProcess, "runBefore")
|
||||
}
|
||||
}
|
||||
}
|
||||
runAfter[taskName].forEach { to ->
|
||||
if (taskNames.contains(to)) {
|
||||
addEdge(result, taskName, to, newToProcess, "runAfter")
|
||||
runAfter[taskName].forEach { to ->
|
||||
if (taskNames.contains(to)) {
|
||||
addEdge(result, taskName, to, newToProcess, "runAfter")
|
||||
}
|
||||
}
|
||||
}
|
||||
seen.add(taskName)
|
||||
|
@ -339,16 +429,14 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
*/
|
||||
fun computePluginTasks(projects: List<Project>) {
|
||||
installAnnotationTasks(projects)
|
||||
installDynamicTasks(projects)
|
||||
installDynamicTasks()
|
||||
}
|
||||
|
||||
private fun installDynamicTasks(projects: List<Project>) {
|
||||
private fun installDynamicTasks() {
|
||||
dynamicTasks.forEach { task ->
|
||||
projects.filter { task.plugin.accept(it) }.forEach { project ->
|
||||
addTask(task.plugin, project, task.name, task.doc, task.group,
|
||||
task.dependsOn, task.reverseDependsOn, task.runBefore, task.runAfter, task.alwaysRunAfter,
|
||||
task.closure)
|
||||
}
|
||||
addTask(task.plugin, task.project, task.name, task.doc, task.group,
|
||||
task.dependsOn, task.reverseDependsOn, task.runBefore, task.runAfter, task.alwaysRunAfter,
|
||||
task.closure)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,14 +85,13 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val
|
|||
* allDependencies is typically either compileDependencies or testDependencies
|
||||
*/
|
||||
override fun calculateDependencies(project: Project?, context: KobaltContext,
|
||||
dependentProjects: List<ProjectDescription>,
|
||||
vararg allDependencies: List<IClasspathDependency>): List<IClasspathDependency> {
|
||||
val result = arrayListOf<IClasspathDependency>()
|
||||
allDependencies.forEach { dependencies ->
|
||||
result.addAll(transitiveClosure(dependencies))
|
||||
}
|
||||
result.addAll(runClasspathContributors(project, context))
|
||||
result.addAll(dependentProjectDependencies(dependentProjects, project, context))
|
||||
result.addAll(dependentProjectDependencies(project, context))
|
||||
|
||||
return result
|
||||
}
|
||||
|
@ -112,9 +111,9 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val
|
|||
*/
|
||||
fun transitiveClosure(dependencies : List<IClasspathDependency>, indent : String = " "):
|
||||
List<IClasspathDependency> {
|
||||
var executor = executors.newExecutor("JvmCompiler}", 10)
|
||||
val executor = executors.newExecutor("JvmCompiler}", 10)
|
||||
|
||||
var result = hashSetOf<IClasspathDependency>()
|
||||
val result = hashSetOf<IClasspathDependency>()
|
||||
|
||||
dependencies.forEach { projectDependency ->
|
||||
log(ConsoleRepositoryListener.LOG_LEVEL, "$indent Resolving $projectDependency")
|
||||
|
@ -169,27 +168,25 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val
|
|||
* If this project depends on other projects, we need to include their jar file and also
|
||||
* their own dependencies
|
||||
*/
|
||||
private fun dependentProjectDependencies(projectDescriptions: List<ProjectDescription>,
|
||||
private fun dependentProjectDependencies(
|
||||
project: Project?, context: KobaltContext) : List<IClasspathDependency> {
|
||||
val result = arrayListOf<IClasspathDependency>()
|
||||
projectDescriptions.filter {
|
||||
it.project.name == project?.name
|
||||
}.forEach { pd ->
|
||||
pd.dependsOn.forEach { p ->
|
||||
if (project == null) {
|
||||
return emptyList()
|
||||
} else {
|
||||
val result = arrayListOf<IClasspathDependency>()
|
||||
project.projectExtra.dependsOn.forEach { p ->
|
||||
result.add(FileDependency(KFiles.joinDir(p.directory, p.classesDir(context))))
|
||||
val otherDependencies = calculateDependencies(p, context, projectDescriptions,
|
||||
p.compileDependencies)
|
||||
val otherDependencies = calculateDependencies(p, context, p.compileDependencies)
|
||||
result.addAll(otherDependencies)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
private fun dependencies(project: Project, context: KobaltContext, isTest: Boolean)
|
||||
: List<IClasspathDependency> {
|
||||
val transitive = hashSetOf<IClasspathDependency>()
|
||||
val projects = listOf(ProjectDescription(project, project.projectExtra.dependsOn))
|
||||
with(project) {
|
||||
val deps = arrayListOf(compileDependencies, compileProvidedDependencies,
|
||||
context.variant.buildType.compileDependencies,
|
||||
|
@ -202,15 +199,20 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val
|
|||
deps.add(testProvidedDependencies)
|
||||
}
|
||||
deps.filter { it.any() }.forEach {
|
||||
transitive.addAll(calculateDependencies(project, context, projects, it))
|
||||
transitive.addAll(calculateDependencies(project, context, it))
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure that classes/ and test-classes/ are always at the top of this classpath,
|
||||
// so that older versions of that project on the classpath don't shadow them
|
||||
val result = listOf(FileDependency(KFiles.makeOutputDir(project).absolutePath),
|
||||
FileDependency(KFiles.makeOutputTestDir(project).absolutePath)) +
|
||||
reorderDependencies(transitive)
|
||||
val result = arrayListOf<IClasspathDependency>().apply {
|
||||
if (isTest) {
|
||||
add(FileDependency(KFiles.makeOutputDir(project).absolutePath))
|
||||
add(FileDependency(KFiles.makeOutputTestDir(project).absolutePath))
|
||||
}
|
||||
addAll(reorderDependencies(transitive))
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
|
@ -18,12 +18,18 @@ public class Md5 {
|
|||
// return DatatypeConverter.printHexBinary(md5.digest()).toLowerCase()
|
||||
// }
|
||||
|
||||
fun toMd5Directories(directories: List<File>) : String? {
|
||||
val ds = directories.filter { it.exists() }
|
||||
/**
|
||||
* Calculate a checksum for all the files/directories. The conversion from File to
|
||||
* bytes can be customized by the @param{toBytes} parameter. The default implementation calculates
|
||||
* a checksum of the last modified timestamp.
|
||||
*/
|
||||
fun toMd5Directories(filesOrDirectories: List<File>,
|
||||
toBytes: (File) -> ByteArray = { it.lastModified().toString().toByteArray() } ): String? {
|
||||
val ds = filesOrDirectories.filter { it.exists() }
|
||||
if (ds.size > 0) {
|
||||
MessageDigest.getInstance("MD5").let { md5 ->
|
||||
var fileCount = 0
|
||||
directories.filter { it.exists() }.forEach { file ->
|
||||
filesOrDirectories.filter { it.exists() }.forEach { file ->
|
||||
if (file.isFile) {
|
||||
val bytes = file.readBytes()
|
||||
md5.update(bytes, 0, bytes.size)
|
||||
|
@ -37,7 +43,7 @@ public class Md5 {
|
|||
it.isFile
|
||||
}.forEach {
|
||||
fileCount++
|
||||
val bytes = it.readBytes()
|
||||
val bytes = toBytes(it)
|
||||
md5.update(bytes, 0, bytes.size)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,9 @@ package com.beust.kobalt.maven
|
|||
import com.beust.kobalt.misc.toString
|
||||
import com.beust.kobalt.misc.warn
|
||||
import com.google.inject.assistedinject.Assisted
|
||||
import kotlinx.dom.childElements
|
||||
import org.w3c.dom.Element
|
||||
import org.w3c.dom.NodeList
|
||||
import org.xml.sax.InputSource
|
||||
import java.io.FileReader
|
||||
import javax.xml.parsers.DocumentBuilderFactory
|
||||
import javax.xml.xpath.XPathConstants
|
||||
|
||||
class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
||||
|
@ -66,8 +64,8 @@ class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
|||
|
||||
init {
|
||||
val DEPENDENCIES = XPATH.compile("/project/dependencies/dependency")
|
||||
val document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(documentFile)
|
||||
|
||||
val document = kotlinx.dom.parseXml(InputSource(FileReader(documentFile)))
|
||||
groupId = XPATH.compile("/project/groupId").evaluate(document)
|
||||
artifactId = XPATH.compile("/project/artifactId").evaluate(document)
|
||||
version = XPATH.compile("/project/version").evaluate(document)
|
||||
|
@ -75,11 +73,12 @@ class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
|||
var repositoriesList = XPATH.compile("/project/repositories").evaluate(document, XPathConstants.NODESET)
|
||||
as NodeList
|
||||
var repoElem = repositoriesList.item(0) as Element?
|
||||
repositories = repoElem.childElements().map({ it.getElementsByTagName("url").item(0).textContent })
|
||||
repositories = childElements(repoElem).map({ it.getElementsByTagName("url").item(0)
|
||||
.textContent })
|
||||
|
||||
val propertiesList = XPATH.compile("/project/properties").evaluate(document, XPathConstants.NODESET) as NodeList
|
||||
var propsElem = propertiesList.item(0) as Element?
|
||||
propsElem.childElements().forEach {
|
||||
childElements(propsElem).forEach {
|
||||
properties.put(it.nodeName, it.textContent)
|
||||
}
|
||||
|
||||
|
@ -111,5 +110,18 @@ class Pom @javax.inject.Inject constructor(@Assisted val id: String,
|
|||
}
|
||||
}
|
||||
|
||||
private fun childElements(repoElem: Element?): List<Element> {
|
||||
val result = arrayListOf<Element>()
|
||||
if (repoElem != null) {
|
||||
for (i in 0..repoElem.childNodes.length - 1) {
|
||||
val elem = repoElem.childNodes.item(i)
|
||||
if (elem is Element) {
|
||||
result.add(elem)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override fun toString() = toString("Pom", "id", id)
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class Io(val dryRun: Boolean = false) {
|
|||
}
|
||||
|
||||
fun mkdir(dir: File) {
|
||||
log("rm -rf $dir")
|
||||
log("mkdir $dir")
|
||||
if (! dryRun) {
|
||||
dir.mkdirs()
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import java.util.jar.JarEntry
|
|||
import java.util.jar.JarFile
|
||||
import java.util.jar.JarInputStream
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipException
|
||||
import java.util.zip.ZipFile
|
||||
import java.util.zip.ZipOutputStream
|
||||
|
||||
|
@ -48,27 +47,14 @@ public class JarUtils {
|
|||
}
|
||||
|
||||
if (foundFile.isDirectory) {
|
||||
log(2, "Writing contents of directory $foundFile")
|
||||
log(2, " Writing contents of directory $foundFile")
|
||||
|
||||
// Directory
|
||||
var name = foundFile.name
|
||||
if (!name.isEmpty()) {
|
||||
if (!name.endsWith("/")) name += "/"
|
||||
val entry = JarEntry(name)
|
||||
entry.time = foundFile.lastModified()
|
||||
try {
|
||||
outputStream.putNextEntry(entry)
|
||||
} catch(ex: ZipException) {
|
||||
log(2, "Can't add $name: ${ex.message}")
|
||||
} finally {
|
||||
outputStream.closeEntry()
|
||||
}
|
||||
}
|
||||
val includedFile = IncludedFile(From(foundFile.path), To(""), listOf(IFileSpec.GlobSpec("**")))
|
||||
addSingleFile(".", includedFile, outputStream, expandJarFiles)
|
||||
val includedFile = IncludedFile(From(""), To(""), listOf(IFileSpec.GlobSpec("**")))
|
||||
addSingleFile(localFile.path, includedFile, outputStream, expandJarFiles)
|
||||
} else {
|
||||
if (file.expandJarFiles && foundFile.name.endsWith(".jar") && ! file.from.contains("resources")) {
|
||||
log(2, "Writing contents of jar file $foundFile")
|
||||
log(2, " Writing contents of jar file $foundFile")
|
||||
val stream = JarInputStream(FileInputStream(localFile))
|
||||
var entry = stream.nextEntry
|
||||
while (entry != null) {
|
||||
|
@ -81,7 +67,7 @@ public class JarUtils {
|
|||
} else {
|
||||
val entryFileName = file.to(foundFile.path).path.replace("\\", "/")
|
||||
val entry = JarEntry(entryFileName)
|
||||
entry.time = foundFile.lastModified()
|
||||
entry.time = localFile.lastModified()
|
||||
addEntry(FileInputStream(localFile), entry, outputStream, onError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,22 +10,25 @@ import java.util.*
|
|||
*/
|
||||
class Topological<T> {
|
||||
private val dependingOn = ArrayListMultimap.create<T, T>()
|
||||
private val nodes = hashSetOf<T>()
|
||||
|
||||
fun addNode(t: T) = nodes.add(t)
|
||||
|
||||
fun addEdge(t: T, other: T) {
|
||||
addNode(t)
|
||||
addNode(other)
|
||||
dependingOn.put(t, other)
|
||||
}
|
||||
|
||||
fun addEdge(t: T, others: Array<out T>) {
|
||||
dependingOn.putAll(t, others.toMutableList())
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Ts sorted topologically.
|
||||
*/
|
||||
fun sort(all: ArrayList<T>) : List<T> {
|
||||
fun sort() : List<T> {
|
||||
val all = ArrayList<T>(nodes)
|
||||
val result = arrayListOf<T>()
|
||||
var dependMap = HashMultimap.create<T, T>()
|
||||
dependingOn.keySet().forEach { dependMap.putAll(it, dependingOn.get(it))}
|
||||
nodes.forEach { dependMap.putAll(it, emptyList())}
|
||||
while (all.size > 0) {
|
||||
val freeNodes = all.filter {
|
||||
dependMap.get(it).isEmpty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue