-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use codegen.kt within codegen.kt - Correctly set JVM targets - Stop publishing Gradle metadata - Add addAnnotation to Annotatable.Builder instead - No longer mark SubSpecDelegateProvider as @CodeGenInternal
- Loading branch information
1 parent
73f2262
commit fc4be35
Showing
27 changed files
with
248 additions
and
178 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import gradle.kotlin.dsl.accessors._8d1ef46afdac024fc616c6e49cc7c389.java | ||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.the | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
import org.gradle.kotlin.dsl.* | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension | ||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget | ||
|
||
fun Project.configureJVMTarget() { | ||
plugins.withId("org.gradle.java") { | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
plugins.withId("org.jetbrains.kotlin.jvm") { | ||
the<KotlinJvmProjectExtension>().compilerOptions { | ||
jvmTarget = JvmTarget.JVM_1_8 | ||
} | ||
} | ||
|
||
plugins.withId("org.jetbrains.kotlin.multiplatform") { | ||
the<KotlinMultiplatformExtension>().targets { | ||
withType<KotlinJvmTarget>().configureEach { | ||
compilations.all { | ||
compilerOptions.configure { | ||
jvmTarget = JvmTarget.JVM_1_8 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") | ||
@file:OptIn(CodeGenInternal::class) | ||
|
||
package dev.kord.codegen.generator.utils | ||
|
||
import com.squareup.kotlinpoet.ClassName | ||
import com.squareup.kotlinpoet.MemberName | ||
import com.squareup.kotlinpoet.asClassName | ||
import dev.kord.codegen.kotlinpoet.CodeGenDsl | ||
import dev.kord.codegen.kotlinpoet.CodeGenInternal | ||
import dev.kord.codegen.kotlinpoet.asMemberName | ||
import dev.kord.codegen.kotlinpoet.delegate.SubSpecDelegateProvider | ||
import dev.kord.codegen.kotlinpoet.delegate.produceByName | ||
import dev.kord.codegen.kotlinpoet.emptyCodeBlock | ||
import kotlin.reflect.KFunction | ||
|
||
private val produceByName: KFunction<SubSpecDelegateProvider<String>> = ::produceByName | ||
|
||
val CODEGEN_DSL = ClassName("dev.kord.codegen.kotlinpoet", "CodeGenDsl") | ||
val EMPTY_CODE_BLOCK = MemberName("dev.kord.codegen.kotlinpoet", "emptyCodeBlock") | ||
val PRODUCE_BY_NAME = MemberName("dev.kord.codegen.kotlinpoet.delegate", "produceByName") | ||
val SUB_SPEC_DELEGATE_PROVIDER = ClassName("dev.kord.codegen.kotlinpoet.delegate", "SubSpecDelegateProvider") | ||
val CODEGEN_DSL = CodeGenDsl::class.asClassName() | ||
val EMPTY_CODE_BLOCK = ::emptyCodeBlock.asMemberName() | ||
val PRODUCE_BY_NAME = produceByName.asMemberName() | ||
val SUB_SPEC_DELEGATE_PROVIDER = SubSpecDelegateProvider::class.asClassName() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.