Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @JvmStatic annotation to Kotlin builders #771

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you do this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install library and plugin and then compile example

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