Skip to content

Commit

Permalink
Add @JvmStatic annotation to Kotlin builders (#771)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle <kbrooks@github.com>
  • Loading branch information
2 people authored and kobylynskyi committed Sep 5, 2021
1 parent e158de9 commit ddaef0f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
19 changes: 10 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ Before sending your pull requests, make sure you followed this list:
Please follow the steps below in order to make the changes:

1. Clone the repository
2. Checkout **develop** branch.
3. Open repository in your favourite IDE.
4. Enable and configure CheckStyle plugin in your IDE (for IntelliJ it is CheckStyle-IDEA).
2. Set the local java version to 1.8
3. Checkout **develop** branch.
4. Open repository in your favourite IDE.
5. Enable and configure CheckStyle plugin in your IDE (for IntelliJ it is CheckStyle-IDEA).
Import [graphql-codegen-check-style.xml](config/checkstyle/graphql-codegen-check-style.xml) as a .
5. Make code changes to the core library of `graphql-java-codegen`.
6. If changes are required in the plugin code, then **build** and **install** `graphql-java-codegen` first.
6. Make code changes to the core library of `graphql-java-codegen`.
7. If changes are required in the plugin code, then **build** and **install** `graphql-java-codegen` first.

```shell script
# This will install the library (including your recent changes) in your local maven repository.
./gradlew clean build publishToMavenLocal
```

7. Build the plugin project with updated `graphql-java-codegen` library.
8. Build the plugin project with updated `graphql-java-codegen` library.

```shell script
# Build Gradle plugin
Expand All @@ -39,8 +40,8 @@ Please follow the steps below in order to make the changes:
mvn clean verify
```

8. Make changes to the plugin code
9. Install the plugin (copy to your local maven repository).
9. Make changes to the plugin code
10. Install the plugin (copy to your local maven repository).

```shell script
# Install Gradle plugin
Expand All @@ -51,4 +52,4 @@ Please follow the steps below in order to make the changes:
mvn clean install
```

10. Make sure that `example` projects are compiling and running.
11. Make sure that `example` projects are compiling and running.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ open class ${className}(private val alias: String?) : GraphQLOperationRequest {
val OPERATION_TYPE: GraphQLOperation = GraphQLOperation.${operationType}
<#if builder>

fun builder(): Builder = Builder()
@JvmStatic fun builder(): Builder = Builder()
</#if>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ open class ${className}()<#if implements?has_content> : <#list implements as int

<#if builder>
companion object {
fun builder(): Builder = Builder()
@JvmStatic fun builder(): Builder = Builder()
}

</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ open class Commit(
) : Closer, IssueTimelineItem, PullRequestTimelineItem, Subscribable, Node, GitObject, UniformResourceLocatable {

companion object {
fun builder(): Builder = Builder()
@JvmStatic fun builder(): Builder = Builder()
}

// In the future, it maybe change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data class TypeWithMandatoryField(
) : InterfaceWithOptionalField {

companion object {
fun builder(): Builder = Builder()
@JvmStatic fun builder(): Builder = Builder()
}

// In the future, it maybe change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open class FunQueryRequest(private val alias: String?) : GraphQLOperationRequest
const val OPERATION_NAME: String = "fun"
val OPERATION_TYPE: GraphQLOperation = GraphQLOperation.QUERY

fun builder(): Builder = Builder()
@JvmStatic fun builder(): Builder = Builder()
}

private val input: MutableMap<String, Any?> = LinkedHashMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data class Super(
) {

companion object {
fun builder(): Builder = Builder()
@JvmStatic fun builder(): Builder = Builder()
}

// In the future, it maybe change.
Expand Down

0 comments on commit ddaef0f

Please sign in to comment.