Skip to content

Commit

Permalink
New implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dstepanov committed Oct 10, 2023
1 parent 68be009 commit 2191cd2
Show file tree
Hide file tree
Showing 41 changed files with 1,764 additions and 414 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ plugins {
tasks.withType(Test).configureEach {
useJUnitPlatform()
}

tasks.withType(Checkstyle).configureEach {
enabled = false
}
44 changes: 6 additions & 38 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
#
# This file is used to declare the list of libraries
# which are used as dependencies in the project.
# See https://docs.gradle.org/7.4.2/userguide/platforms.html#sub:central-declaration-of-dependencies
#
# For Micronaut, we have 3 kinds of dependencies:
# - managed dependencies, which are exposed to consumers via a BOM (or version catalog)
# - managed BOMs, which are imported into the BOM that we generate
# - all other dependencies, which are implementation details
#
# If a library needs to appear in the BOM of the project, then it must be
# declared with the "managed-" prefix.
# If a BOM needs to be imported in the BOM of the project, then it must be
# declared with the "boms-" prefix.
# Both managed dependencies and BOMs need to have their version declared via
# a managed version (a version which alias starts with "managed-"

[versions]
micronaut = "4.0.3-SNAPSHOT"
micronaut = "4.2.0-SNAPSHOT"
micronaut-docs = "2.0.0"
micronaut-test = "3.9.1"
groovy = "4.0.12"
spock = "2.3-groovy-4.0"
javapoet = "1.13.0"
kotlinpoet = "1.14.2"
managed-javapoet = "1.13.0"
managed-kotlinpoet = "1.14.2"

# Managed versions appear in the BOM
# managed-somelib = "1.0"
Expand All @@ -31,24 +14,9 @@ kotlinpoet = "1.14.2"
[libraries]
# Core
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" }
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
kotlinpoet-javapoet = { module = "com.squareup:kotlinpoet-javapoet", version.ref = "kotlinpoet" }

#
# Managed dependencies appear in the BOM
#
# managed-somelib = { module = "group:artifact", version.ref = "managed-somelib" }

#
# Imported BOMs, also appearing in the generated BOM
#
# boms-somebom = { module = "com.foo:somebom", version.ref = "managed-somebom" }

# Other libraries used by the project but non managed

# micronaut-bom = { module = "io.micronaut:micronaut-bom", version.ref = "micronaut" }
# jdoctor = { module = "me.champeau.jdoctor:jdoctor-core", version.ref="jdoctor" }
managed-javapoet = { module = "com.squareup:javapoet", version.ref = "managed-javapoet" }
managed-kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "managed-kotlinpoet" }
managed-kotlinpoet-javapoet = { module = "com.squareup:kotlinpoet-javapoet", version.ref = "managed-kotlinpoet" }

[bundles]

Expand Down
7 changes: 6 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ plugins {
rootProject.name = "sourcegen-parent"

include("sourcegen-annotations")
include("sourcegen-core")
include("sourcegen-model")
include("sourcegen-generator")
include("sourcegen-generator-java")
include("sourcegen-generator-kotlin")
include("sourcegen-bom")

include("test-suite-java")
//include("test-suite-groovy") TODO
include("test-suite-kotlin")

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Copyright 2003-2021 the original author or authors.
* Copyright 2017-2021 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micronaut.sourcegen.ann;
package io.micronaut.sourcegen.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand All @@ -22,6 +22,12 @@

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* The builder annotation on a bean should create a builder.
*
* @author Denis Stepanov
* @since 1.0
*/
@Documented
@Retention(RUNTIME)
@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
Expand Down
12 changes: 6 additions & 6 deletions sourcegen-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ plugins {
}

dependencies {
compileOnly(mn.micronaut.inject.java)
implementation(projects.sourcegenAnnotations)
implementation(libs.javapoet)
implementation(libs.kotlinpoet)
implementation(libs.kotlinpoet.javapoet)
testAnnotationProcessor(project)
// compileOnly(mn.micronaut.inject.java)
// implementation(projects.sourcegenAnnotations)
// implementation(libs.managed.javapoet)
// implementation(libs.managed.kotlinpoet)
// implementation(libs.managed.kotlinpoet.javapoet)
// testAnnotationProcessor(project)
}

This file was deleted.

Loading

0 comments on commit 2191cd2

Please sign in to comment.