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

Fixes gradle scripts #215

Merged
merged 1 commit into from
Jan 8, 2025
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
12 changes: 12 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id("groovy-gradle-plugin")
}

repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation(libs.micronaut.gradle.plugin)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencyResolutionManagement {
versionCatalogs {
libs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
id("io.micronaut.build.internal.sourcegen-base")
id("io.micronaut.build.internal.module")
}

micronautBuild {
binaryCompatibility {
enabled.set(false)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ tasks.withType(Test).configureEach {
tasks.withType(Checkstyle).configureEach {
enabled = false
}

if (System.getenv("SONAR_TOKEN") != null) {
tasks.configureEach { if (it.name == "testCodeCoverageReport") { enabled = false } }
}
14 changes: 0 additions & 14 deletions build.gradle

This file was deleted.

17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
id("io.micronaut.build.internal.sourcegen-base")
id("io.micronaut.build.internal.docs")
id("io.micronaut.build.internal.quality-reporting")
}

if (System.getenv("SONAR_TOKEN") != null) {
tasks.named("testCodeCoverageReport") { enabled = false }
}

afterEvaluate {
configurations.javadocAggregatorBase.configure {
dependencies.removeIf {
it.name.startsWith("test-suite")
}
}
}
14 changes: 0 additions & 14 deletions buildSrc/build.gradle

This file was deleted.

This file was deleted.

13 changes: 5 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ projectUrl=https://micronaut.io
githubSlug=micronaut-projects/micronaut-sourcegen
developers=Denis Stepanov

# Micronaut core branch for BOM pull requests
githubCoreBranch=3.8.x

# bomProperty=micronautXXXVersion
# If needed, set additional properties
# bomProperties=hibernateVersion,tomcatJdbcVersion

org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
org.gradle.configuration-cache=false
org.gradle.configuration-cache.parallel=false
org.gradle.caching=true
org.gradle.jvmargs=-Xmx1g
org.gradle.parallel=true
kotlin.stdlib.default.dependency=false
25 changes: 11 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[versions]
micronaut = "4.7.10"
micronaut-platform = "4.6.3"
micronaut-docs = "2.0.0"
micronaut-test = "4.1.0"
micronaut-data = "4.9.6"
micronaut-validation = "4.8.0"
micronaut-gradle-plugin = "4.4.4"
managed-kotlinpoet = "2.0.0"

google-truth = "1.4.4"
google-compile-testing = "0.21.0"
google-jimfs = "1.3.0"
kotlin = '1.9.25'
ksp = '1.9.24-1.0.20'
asm = "9.7.1"
intellij-java-decompiler = "242.23726.103"
intellij-java-decompiler = "243.22562.218"

micronaut = "4.7.10"
micronaut-platform = "4.7.3"
micronaut-docs = "2.0.0"
micronaut-test = "4.6.2"
micronaut-data = "4.10.5"
micronaut-validation = "4.8.0"
micronaut-gradle-plugin = "4.4.4"

[libraries]
# Core
# Micronaut
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
micronaut-data = { module = 'io.micronaut.data:micronaut-data-bom', version.ref = 'micronaut-data' }
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" }
Expand All @@ -32,9 +32,6 @@ asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }
google-truth = { module = "com.google.truth:truth", version.ref = "google-truth" }
google-compile-testing = { module = "com.google.testing.compile:compile-testing", version.ref = "google-compile-testing" }
google-jimfs = { module = "com.google.jimfs:jimfs", version.ref = "google-jimfs" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }

micronaut-gradle-plugin = { module = "io.micronaut.gradle:micronaut-gradle-plugin", version.ref="micronaut-gradle-plugin" }
kotlin-gradle-plugin = { module = 'org.jetbrains.kotlin:kotlin-gradle-plugin', version.ref = 'kotlin' }
kotlin-gradle-allopen = { module = 'org.jetbrains.kotlin:kotlin-allopen', version.ref = 'kotlin' }
intellij-java-decompiler = { module = 'com.jetbrains.intellij.java:java-decompiler-engine', version.ref = 'intellij-java-decompiler' }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pluginManagement {
}
}

includeBuild("build-logic")

plugins {
id("io.micronaut.build.shared.settings") version "7.2.3"
}
Expand Down Expand Up @@ -40,4 +42,3 @@ dependencyResolutionManagement {
mavenCentral()
}
}

8 changes: 6 additions & 2 deletions sourcegen-bytecode-writer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ repositories {

dependencies {
api(projects.sourcegenModel)
compileOnly(mn.micronaut.core.processor)
api(libs.asm)
api(libs.asm.commons)
api(libs.asm.util)

compileOnly(mn.micronaut.core.processor)

testImplementation(mn.micronaut.core.processor)
testImplementation(libs.junit.jupiter.engine)
testImplementation(mnTest.junit.jupiter.api)
testImplementation(libs.intellij.java.decompiler)
testImplementation(projects.testSuiteCustomGenerators)

testRuntimeOnly(mnTest.junit.jupiter.engine)
}

tasks.withType<Test> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.objectweb.asm.commons.GeneratorAdapter;

final class CastExpressionWriter implements ExpressionWriter {

private final ExpressionDef.Cast castExpressionDef;

public CastExpressionWriter(ExpressionDef.Cast castExpressionDef) {
Expand Down Expand Up @@ -128,7 +129,6 @@ private static ClassTypeDef getSuperclass(ObjectDef objectDef) {
return null;
}


private static void checkCast(GeneratorAdapter generatorAdapter, MethodContext context, TypeDef from, TypeDef to) {
TypeDef toType = ObjectDef.getContextualType(context.objectDef(), to);
if (!toType.makeNullable().equals(from.makeNullable())) {
Expand Down
Loading
Loading