Skip to content

Commit

Permalink
WIP migrate to Micronaut 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Dec 8, 2023
1 parent 5b26cc8 commit 87a453a
Show file tree
Hide file tree
Showing 197 changed files with 299 additions and 300 deletions.
19 changes: 13 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ plugins {
id 'io.github.gradle-nexus.publish-plugin'
}

logger.lifecycle "Using Micronaut $micronautVersion"

if (!project.hasProperty('ossrhUsername')) ext.ossrhUsername = System.getenv('SONATYPE_USERNAME') ?: '**UNDEFINED**'
if (!project.hasProperty('ossrhPassword')) ext.ossrhPassword = System.getenv('SONATYPE_PASSWORD') ?: '**UNDEFINED**'
if (!project.hasProperty('signingKeyId')) ext.signingKeyId = System.getenv('SIGNING_KEY_ID') ?: '**UNDEFINED**'
Expand Down Expand Up @@ -152,9 +150,18 @@ subprojects { Project subproject ->
apply plugin: 'groovy'
apply plugin: 'java-library'

micronaut {
importMicronautPlatorm = true
testRuntime 'spock'
if (subproject.projectDir.parentFile.name.equals('subprojects')) {
micronaut {
if (it.hasProperty('importMicronautPlatform')) {
importMicronautPlatform = true
} else {
project.logger.lifecycle "No importMicronautPlatform property found for ${micronaut.dump()}"
}
testRuntime 'spock2'
processing {
incremental false
}
}
}

dependencies {
Expand All @@ -163,7 +170,7 @@ subprojects { Project subproject ->
// Groovy
if (subproject.name.startsWith('micronaut-amazon-awssdk')) {
compileOnly "org.apache.groovy:groovy:$groovyVersion"
testImplementation "org.apace.groovy:groovy:$groovyVersion"
testImplementation "org.apache.groovy:groovy:$groovyVersion"
} else {
implementation "org.apache.groovy:groovy:$groovyVersion"
implementation micronautMigratedDependency('micronaut-runtime-groovy')
Expand Down
2 changes: 1 addition & 1 deletion examples/local-server/local-server.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/
plugins {
id 'io.micronaut.minimal.application' version "$micronautGradlePluginVersion"
id 'io.micronaut.minimal.application'
}

config {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import io.micronaut.context.annotation.Primary
import io.micronaut.retry.annotation.Fallback

import javax.annotation.PostConstruct
import javax.inject.Singleton
import jakarta.inject.Singleton

/**
* Mock services for the example application.
Expand Down
2 changes: 1 addition & 1 deletion examples/planets/planets.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buildscript {
}

plugins {
id 'io.micronaut.minimal.library' version "$micronautGradlePluginVersion"
id 'io.micronaut.minimal.library'
}

apply from: '../gradle/lambda.gradle'
Expand Down
2 changes: 1 addition & 1 deletion examples/spacecrafts/spacecrafts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buildscript {
}

plugins {
id 'io.micronaut.minimal.library' version "$micronautGradlePluginVersion"
id 'io.micronaut.minimal.library'
}

apply from: '../gradle/lambda.gradle'
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ slug=agorapulse/micronaut-aws-sdk
group=com.agorapulse
micronautVersion = 4.2.0
micronautGradlePluginVersion = 4.2.0
gruVersion = 0.9.1
gruVersion = 2.0.4
druVersion = 0.8.1
spockVersion = 2.0-groovy-2.5
awsSdkVersion = 1.12.299
awsSdk2Version = 2.18.40
testcontainersVersion = 1.17.3
Expand All @@ -31,9 +30,10 @@ gitPublishPluginVersion=2.1.3
nexusPluginVersion=1.0.0
closureSupportVersion=0.6.3
mockitoVersion=2.23.4
kotlinVersion=1.9.21

# other versions creates conflicts in Groovydoc
groovyVersion = 2.5.8
groovyVersion = 4.0.16

# this should be aligned to Micronaut version
# required for AWS CBOR marshalling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ javaPlatform {
}

dependencies {
api platform("io.micronaut:micronaut-bom:$micronautVersion")

constraints {
api "com.amazonaws:aws-java-sdk-cloudwatch:$project.awsSdkVersion"
api "com.amazonaws:aws-java-sdk-logs:$project.awsSdkVersion"
Expand Down
12 changes: 5 additions & 7 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ pluginManagement {

buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url 'https://agorapulse.jfrog.io/agorapulse/gradle-plugins-releases-local/'
}
}
dependencies {
classpath "com.agorapulse.gradle:internal-maven-publish:$agorapulseGradlePluginsVersion"
classpath("io.micronaut.gradle:micronaut-minimal-plugin:$micronautGradlePluginVersion")
}
}

Expand All @@ -51,6 +49,7 @@ plugins {

gradleEnterprise {
buildScan {
publishAlways()
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"

Expand All @@ -62,12 +61,11 @@ gradleEnterprise {


projects {
directories = ['subprojects', 'examples', 'docs', 'benchmarks']
directories = ['subprojects', 'examples', 'docs', 'benchmarks', 'platforms']

plugins {
dir('subproject') {
dir('subprojects') {
id 'io.micronaut.minimal.library'
id 'com.agorapulse.gradle:internal-maven-publish'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.micronaut.context.annotation.Requires;
import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;

import javax.inject.Named;
import jakarta.inject.Named;

/**
* Default simple storage service configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClientBuilder;
import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Optional;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.micronaut.context.annotation.Requires;
import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient;

import javax.inject.Named;
import jakarta.inject.Named;

/**
* Default simple storage service configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsAsyncClientBuilder;
import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Optional;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import software.amazon.awssdk.services.cloudwatchlogs.model.OutputLogEvent;
import software.amazon.awssdk.services.cloudwatchlogs.model.ResourceNotFoundException;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.List;
import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.regions.providers.*;

import javax.inject.Singleton;
import jakarta.inject.Singleton;

@Factory
public class AwsConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
package com.agorapulse.micronaut.amazon.awssdk.core;

import javax.annotation.Nullable;
import io.micronaut.core.annotation.Nullable;

/**
* Default region and endpoint configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import io.micronaut.core.annotation.NonNull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -32,13 +32,13 @@ public class DynamoDbBeanAnnotationRemapper implements AnnotationRemapper {
private static final String PACKAGE_NAME = "software.amazon.awssdk.enhanced.dynamodb.mapper.annotations";
private static final String ANNOTATION_NAME = PACKAGE_NAME + ".DynamoDbBean";

@Nonnull
@NonNull
@Override
public String getPackageName() {
return PACKAGE_NAME;
}

@Nonnull
@NonNull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
if (ANNOTATION_NAME.equals(annotation.getAnnotationName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import io.micronaut.core.annotation.NonNull;
import java.util.Collections;
import java.util.List;

public class ServiceAnnotationRemapper implements AnnotationRemapper {

@Nonnull
@NonNull
@Override
public String getPackageName() {
return "com.agorapulse.micronaut.amazon.awssdk.dynamodb.annotation";
}

@Nonnull
@NonNull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
return Collections.singletonList(annotation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,21 @@
* limitations under the License.
*/
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id 'org.jetbrains.kotlin.kapt' version '1.6.21'
id 'org.jetbrains.kotlin.plugin.allopen' version '1.6.21'
id 'org.jetbrains.kotlin.jvm' version "$kotlinVersion"
id 'org.jetbrains.kotlin.plugin.allopen' version "$kotlinVersion"
id 'com.google.devtools.ksp' version '1.9.21-1.0.15'
}


dependencies {
api project(':micronaut-amazon-awssdk-dynamodb')

kapt platform("io.micronaut:micronaut-bom:$micronautVersion")
api platform(project(':micronaut-aws-sdk-dependencies'))

kapt 'io.micronaut:micronaut-inject-java'
kapt project(':micronaut-amazon-awssdk-dynamodb-annotation-processor')
ksp project(':micronaut-amazon-awssdk-dynamodb-annotation-processor')

implementation 'io.micronaut:micronaut-inject'
implementation 'io.micronaut:micronaut-runtime'

kaptTest 'io.micronaut:micronaut-inject-java'
testImplementation 'io.micronaut.test:micronaut-test-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import software.amazon.awssdk.enhanced.dynamodb.MappedTableResource;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Map;
import java.util.stream.Collectors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.concurrent.ConcurrentHashMap;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import software.amazon.awssdk.services.dynamodb.model.Projection;
import software.amazon.awssdk.services.dynamodb.model.ProjectionType;

import javax.annotation.Nullable;
import io.micronaut.core.annotation.Nullable;
import java.lang.annotation.Annotation;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import software.amazon.awssdk.enhanced.dynamodb.internal.mapper.MetaTableSchemaCache;
import software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema;

import javax.inject.Singleton;
import jakarta.inject.Singleton;

@Singleton
public class DefaultTableSchemaCreator implements TableSchemaCreator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.DynamoDbClientBuilder;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Optional;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.micronaut.context.annotation.Primary;
import io.micronaut.context.annotation.Requires;

import javax.inject.Named;
import jakarta.inject.Named;

/**
* Default DynamoDB configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;

import javax.inject.Singleton;
import jakarta.inject.Singleton;

/**
* Factory class which provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable;
import software.amazon.awssdk.enhanced.dynamodb.Key;

import javax.annotation.Nullable;
import io.micronaut.core.annotation.Nullable;
import java.util.function.Consumer;
import java.util.function.Function;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.micronaut.core.beans.BeanIntrospection;
import io.micronaut.core.beans.BeanIntrospector;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Map;
import java.util.function.Function;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import reactor.core.publisher.Flux;
import software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.util.Collections;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import io.micronaut.aop.Introduction;
import io.micronaut.context.annotation.Type;

import javax.inject.Scope;
import javax.inject.Singleton;
import jakarta.inject.Scope;
import jakarta.inject.Singleton;
import java.lang.annotation.*;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.annotation.Requires;

import javax.inject.Singleton;
import jakarta.inject.Singleton;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.function.Function;
Expand Down
Loading

0 comments on commit 87a453a

Please sign in to comment.