Skip to content

Commit

Permalink
Merge pull request #6 from teogor/env/migrate-to-java-17
Browse files Browse the repository at this point in the history
Migrate to Java 17
  • Loading branch information
teogor authored Feb 21, 2024
2 parents 9901480 + 6d1a87c commit 4b59f48
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 88 deletions.
29 changes: 3 additions & 26 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/querent.iml

This file was deleted.

15 changes: 1 addition & 14 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`

alias(libs.plugins.winds)
}

val javaVersion = JavaVersion.VERSION_11
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
languageVersion = "1.8"
jvmTarget = javaVersion.toString()
alias(libs.plugins.teogor.winds)
}

dependencies {
Expand Down
37 changes: 26 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import com.diffplug.spotless.LineEnding
import com.vanniktech.maven.publish.SonatypeHost
import dev.teogor.winds.api.MavenPublish
import dev.teogor.winds.api.getValue
import dev.teogor.winds.api.model.Contributor
import dev.teogor.winds.api.model.DependencyType
import dev.teogor.winds.api.model.Developer
import dev.teogor.winds.api.model.IssueManagement
import dev.teogor.winds.api.model.LicenseType
import dev.teogor.winds.api.model.createVersion
import dev.teogor.winds.api.provider.Scm
import dev.teogor.winds.gradle.tasks.impl.subprojectChildrens
import dev.teogor.winds.gradle.utils.afterWindsPluginConfiguration
import dev.teogor.winds.gradle.utils.attachTo
import org.gradle.internal.classpath.Instrumented.systemProperties
import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
repositories {
Expand All @@ -20,20 +24,32 @@ buildscript {

// Lists all plugins used throughout the project without applying them.
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.jvm) apply true
alias(libs.plugins.kotlin.serialization) apply false

alias(libs.plugins.winds) apply true
alias(libs.plugins.teogor.winds) apply true
alias(libs.plugins.vanniktech.maven) apply true
alias(libs.plugins.dokka) apply true
alias(libs.plugins.spotless) apply true
alias(libs.plugins.api.validator) apply true
}

// Explicitly set the group and version for all subprojects
subprojects {
group = "dev.teogor.querent"
version = "1.0.0-alpha01"
subprojectChildrens {
val javaVersion = JavaVersion.VERSION_17
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = javaVersion.toString()
}

val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = javaVersion.toString()
}
}

winds {
Expand All @@ -60,10 +76,6 @@ winds {
alphaRelease(1)
}

// TODO winds
// required by dokka
project.version = version!!.toString()

inceptionYear = 2023

sourceControlManagement(
Expand All @@ -86,6 +98,9 @@ winds {
}

afterWindsPluginConfiguration { winds ->
group = winds.mavenPublish.groupId ?: "undefined"
version = winds.mavenPublish.version ?: "undefined"

if (!plugins.hasPlugin("com.gradle.plugin-publish")) {
val mavenPublish: MavenPublish by winds
if (mavenPublish.canBePublished) {
Expand Down
22 changes: 5 additions & 17 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,13 @@
* limitations under the License.
*/

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
alias(libs.plugins.gradle.publish)
alias(libs.plugins.build.config)
alias(libs.plugins.kotlin.serialization)

alias(libs.plugins.winds)
}

val javaVersion = JavaVersion.VERSION_11
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
languageVersion = "1.8"
jvmTarget = javaVersion.toString()
alias(libs.plugins.teogor.winds)
}

dependencies {
Expand Down Expand Up @@ -79,6 +65,8 @@ winds {
buildConfig {
packageName("dev.teogor.querent")

buildConfigField("String", "NAME", "\"${group}\"")
buildConfigField("String", "VERSION", "\"${version}\"")
afterEvaluate {
buildConfigField("String", "NAME", "\"${group}\"")
buildConfigField("String", "VERSION", "\"${version}\"")
}
}
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kotlinx-serialization-json = "1.5.1"
ksp = "1.9.0-1.0.13"
spotless = "6.20.0"
vanniktech-maven-plugin = "0.25.3"
winds = "1.0.0-alpha03"
teogor-winds = "1.0.0-beta02"
xenoglot-bom = "1.0.0-alpha01"

[libraries]
Expand Down Expand Up @@ -45,6 +45,6 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
vanniktech-maven = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-maven-plugin" }
winds = { id = "dev.teogor.winds", version.ref = "winds" }
teogor-winds = { id = "dev.teogor.winds", version.ref = "teogor-winds" }

[bundles]

0 comments on commit 4b59f48

Please sign in to comment.