Merge pull request #536 from square/jwilson.0514.cast_shade

Shade unreleased KotlinPoet 0.7.0.
This commit is contained in:
Jesse Wilson
2018-05-14 22:52:35 -04:00
committed by GitHub
2 changed files with 38 additions and 7 deletions

View File

@@ -528,8 +528,8 @@ data class BlackjackHand(
The codegen adapter requires that your Kotlin types and their properties be either `internal` or The codegen adapter requires that your Kotlin types and their properties be either `internal` or
`public` (this is Kotlins default visibility). `public` (this is Kotlins default visibility).
Kotlin codegen has no additional runtime dependency. Youll need to add the following to your build Kotlin codegen has no additional runtime dependency. Youll need to [enable kapt][kapt] and then
to enable the annotation processor: add the following to your build to enable the annotation processor:
```xml ```xml
<dependency> <dependency>
@@ -618,3 +618,4 @@ License
[okhttp]: https://github.com/square/okhttp/ [okhttp]: https://github.com/square/okhttp/
[gson]: https://github.com/google/gson/ [gson]: https://github.com/google/gson/
[javadoc]: https://square.github.io/moshi/1.x/moshi/ [javadoc]: https://square.github.io/moshi/1.x/moshi/
[kapt]: https://kotlinlang.org/docs/reference/kapt.html

View File

@@ -22,6 +22,11 @@
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId> <artifactId>kotlin-stdlib</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>kotlinpoet</artifactId>
<version>0.7.0</version>
</dependency>
<dependency> <dependency>
<groupId>com.google.auto</groupId> <groupId>com.google.auto</groupId>
<artifactId>auto-common</artifactId> <artifactId>auto-common</artifactId>
@@ -33,11 +38,6 @@
<version>1.0-rc4</version> <version>1.0-rc4</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>kotlinpoet</artifactId>
<version>0.7.0</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
@@ -151,6 +151,36 @@
<useManifestOnlyJar>false</useManifestOnlyJar> <useManifestOnlyJar>false</useManifestOnlyJar>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.squareup:kotlinpoet</include>
</includes>
</artifactSet>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<relocations>
<!-- Repackage KotlinPoet until its API is stable. -->
<relocation>
<pattern>com.squareup.kotlinpoet</pattern>
<shadedPattern>com.squareup.moshi.kotlinpoet</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>