Skip to content

Commit

Permalink
Merge pull request #27 from atsushi130/fix/generates-interface
Browse files Browse the repository at this point in the history
Fix output file path
  • Loading branch information
atsushi130 authored Jan 31, 2018
2 parents 304a559 + 1670e78 commit f445c7e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
35 changes: 33 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jre8</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>

<distributionManagement>
Expand All @@ -100,8 +105,34 @@
</pluginRepositories>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Version](https://img.shields.io/maven-central/v/com.github.atsushi130/builderkit.svg)](https://search.maven.org/#search|gav|1|g%3A"com.github.atsushi130"%20AND%20a%3A"builderkit")

## Usage
Implement Generator class to `/src/gen/kotlin`.
Implement Generator class to `/generate/src/`.
```kotlin
class Generator {
companion object {
Expand All @@ -18,9 +18,9 @@ class Generator {
}
}
```
Builder class is automatically generated to `src/gen/kotlin/` by default.
Builder class is automatically generated to `generate/src/` by default.

## Outout Builder class
## Output Builder class
**Sample model class**
```kotlin
data class ModelClass(val arg1: Int, val arg2: List<String>, val arg3: MyClass)
Expand Down Expand Up @@ -60,7 +60,7 @@ import java.io.File
class Generator {
companion object {
@JvmStatic fun main(vararg args: String) {
val builder = BuilderGenerator(indent = "\t", path = File("src/gen/kotlin/"))
val builder = BuilderGenerator(indent = "\t", path = File("generate/src/"))
builder.generates(ModelClass::class)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/builderkit/BuilderGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BuilderGenerator(private val indent: String, private val path: File) {
/**
* Default output file path
*/
private val path = File("src/gen/kotlin/")
private val path = File("generate/src")

/**
* Default indent
Expand Down

0 comments on commit f445c7e

Please sign in to comment.