Skip to content

Commit

Permalink
upgaded to Grails 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Oct 25, 2023
1 parent 1fe5113 commit 93f83fe
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 64 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ jobs:
GRADLE_OPTS: "-Xmx6g -Xms4g"
CI: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
strategy:
fail-fast: false
matrix:
versions:
- 'check coveralls -PmicronautVersion=1.3.7 -PspockVersion=2.0-groovy-2.5 -PgroovyVersion=2.5.15 -PgrailsVersion=4.0.4 -Pgorm.version=7.0.6.RELEASE'
- 'check -x :micronaut-grails-domain-library:check -x :micronaut-grails-example:check -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -PgrailsVersion=5.1.1 -Pgorm.version=7.1.2'
- 'migrateImports check -PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -PgrailsVersion=5.1.1 -Pgorm.version=7.1.2'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
Expand All @@ -25,7 +18,7 @@ jobs:
cache: 'gradle'
- uses: eskatos/gradle-command-action@v2
with:
arguments: ${{ matrix.versions }}
arguments: check coveralls
- name: Show Reports
uses: actions/upload-artifact@v2
if: failure()
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,21 @@ jobs:
with:
fileName: 'secret.pgp'
encodedString: ${{ secrets.SIGNING_SECRET_KEY_BASE64 }}
- name: Release Micronaut 1.x
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: eskatos/gradle-command-action@v2
with:
arguments: -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-1.0 --stacktrace -PmicronautVersion=1.3.7 -PspockVersion=2.0-groovy-2.5 -PgroovyVersion=2.5.15 -PgrailsVersion=4.0.4 -Pgorm.version=7.0.6.RELEASE -Prelease=true
- name: Release Micronaut 2.x
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: eskatos/gradle-command-action@v2
with:
arguments: -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-2.0 --stacktrace -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -PgrailsVersion=5.1.1 -Pgorm.version=7.1.2 -Prelease=true
- name: Release Micronaut 3.x
env:
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
uses: eskatos/gradle-command-action@v2
with:
arguments: migrateImports gitPublishPush -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-3.0 --stacktrace -PmicronautVersion=3.2.3 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -PgrailsVersion=5.1.1 -Pgorm.version=7.1.2 -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}
arguments: migrateImports gitPublishPush -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }} -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}
ping:
name: Notify Upstream Repositories
runs-on: ubuntu-latest
needs: [release]
strategy:
matrix:
repository:
- agorapulse/agorapulse-bom
# no need for automatic update of the all BOM as this would break old Grails application if the upgrade fails
# - agorapulse/agorapulse-bom
- agorapulse/agorapulse-oss
steps:
- uses: actions/checkout@v1
Expand All @@ -68,4 +57,4 @@ jobs:
token: ${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}
repository: ${{ matrix.repository }}
event-type: ap-new-version-released-event
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-grails", "version": "${{ steps.version.outputs.tag }}-micronaut-1.0", "property" : "micronaut.grails.version", "github" : ${{ toJson(github) }} }'
client-payload: '{ "group": "com.agorapulse", "module": "micronaut-grails", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.grails.version", "github" : ${{ toJson(github) }} }'
6 changes: 0 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,4 @@ subprojects { Project subproject ->
codenarc {
toolVersion = '2.1.0'
}

config {
bintray {
name = subproject.name
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.agorapulse.micronaut.grails.example.InjectedWithQualifier
import grails.compiler.GrailsCompileStatic
import grails.converters.JSON

import javax.inject.Inject
import javax.inject.Named
import jakarta.inject.Inject
import jakarta.inject.Named

@GrailsCompileStatic
class TestController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import groovy.transform.CompileStatic
import io.micronaut.context.ApplicationContext
import io.micronaut.context.annotation.Value

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

@Singleton
@CompileStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import groovy.transform.CompileStatic
import io.micronaut.context.ApplicationContext
import io.micronaut.context.annotation.Value

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

@Singleton
@CompileStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.agorapulse.micronaut.grails.example

import groovy.transform.CompileStatic

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

@Singleton
@CompileStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package com.agorapulse.micronaut.grails.example

import groovy.transform.CompileStatic

import javax.inject.Named
import javax.inject.Singleton
import jakarta.inject.Named
import jakarta.inject.Singleton

@Singleton
@Named('test')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package micronaut.grails.example.other.model

import groovy.transform.CompileStatic
import javax.annotation.Nullable
import io.micronaut.core.annotation.Nullable
import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

slug=agorapulse/micronaut-grails
group=com.agorapulse
version = 3.0.0-SNAPSHOT
version = 4.0.0-SNAPSHOT

micronautVersion = 1.3.7
grailsVersion=4.0.4
micronautVersion = 3.10.1
grailsVersion=5.3.3
gruVersion = 0.9.4
druVersion = 0.8.1
groovyVersion = 2.5.8
Expand All @@ -34,8 +34,8 @@ dockerApiVersion = 3.2.12
groovyClosureSupportVersion = 0.6.3
kordampVersion=0.46.0
nexusPluginVersion=1.0.0
grailsTestingSupportVersion=2.1.2
hibernateVersion=5.6.3.Final
grailsTestingSupportVersion=2.6.1
hibernateVersion=5.6.11.Final

# 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 @@ -335,7 +335,7 @@ abstract class MicronautDataGenerator {
Set<String> imports
) {
if (unified.nullable) {
imports.add('javax.annotation.Nullable')
imports.add('io.micronaut.core.annotation.Nullable')
writer.println(' @Nullable')
} else if (!unified.persistentProperty.type.primitive) {
imports.add('javax.validation.constraints.NotNull')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

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

@Configuration
public class MicronuatDataGeneratorConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import javax.annotation.Nonnull;
import io.micronaut.core.annotation.NonNull;
import java.net.URLClassLoader;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -147,7 +147,7 @@ public void destroy() {
}

@Override
public void setApplicationContext(@Nonnull ApplicationContext applicationContext) throws BeansException {
public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException {
this.springContext = applicationContext;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;

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

Expand Down Expand Up @@ -119,7 +119,7 @@ protected ApplicationContext initializeMicronautContext() {
}

@Override
public void setEnvironment(@Nonnull Environment environment) {
public void setEnvironment(@NonNull Environment environment) {
this.environment = environment;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.Nullable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand All @@ -51,7 +51,7 @@ class GrailsPropertyTranslatingEnvironment extends DefaultEnvironment {

GrailsPropertyTranslatingEnvironment(Environment environment, PropertyTranslatingCustomizer customizer, List<String> expectedMapProperties) {
super(new ApplicationContextConfiguration() {
@Nonnull
@NonNull
@Override
public List<String> getEnvironments() {
return Arrays.asList(environment.getActiveProfiles());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import io.micronaut.context.ApplicationContext;

import javax.annotation.Nonnull;
import javax.inject.Singleton;
import io.micronaut.core.annotation.NonNull;
import jakarta.inject.Singleton;

@Singleton
public class MicronautContextHolder {
Expand All @@ -31,7 +31,7 @@ public MicronautContextHolder(ApplicationContext context) {
this.context = context;
}

@Nonnull
@NonNull
public ApplicationContext getContext() {
return context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import javax.annotation.Nonnull;
import io.micronaut.core.annotation.NonNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -84,7 +84,7 @@ public MicronautGrailsAppContextConfiguration(
}

@Override
@Nonnull
@NonNull
public List<String> getEnvironments() {
List<String> environments = new ArrayList<>();
environments.add(ENVIRONMENT);
Expand All @@ -100,7 +100,7 @@ public Optional<Boolean> getDeduceEnvironments() {
return Optional.of(false);
}

@Override @Nonnull
@Override @NonNull
public ClassLoader getClassLoader() {
return applicationClassLoader;
}
Expand All @@ -117,8 +117,8 @@ public MicronautGrailsAppContext(MicronautGrailsAppContextConfiguration micronau
}

@Override
@Nonnull
protected DefaultEnvironment createEnvironment(@Nonnull ApplicationContextConfiguration c) {
@NonNull
protected DefaultEnvironment createEnvironment(@NonNull ApplicationContextConfiguration c) {
DefaultEnvironment environment = (DefaultEnvironment) super.createEnvironment(c);
((MicronautGrailsAppContextConfiguration)c).getConfiguration().configureEnvironment(environment);
return environment;
Expand Down Expand Up @@ -208,6 +208,8 @@ protected void configureEnvironment(ConfigurableEnvironment environment, String[
@Override
protected ConfigurableApplicationContext createApplicationContext() {
setAllowBeanDefinitionOverriding(true);
setAllowCircularReferences(true);


ConfigurableApplicationContext applicationContext = createSpringApplicationContext();

Expand Down Expand Up @@ -243,7 +245,7 @@ protected ConfigurableApplicationContext createApplicationContext() {
return applicationContext;
}

@Nonnull
@NonNull
private MicronautGrailsAutoConfiguration getApplication() {
try {
return getAllSources()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import io.micronaut.context.Qualifier;

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

public class TypeAndQualifier<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.TestPropertySource
import spock.lang.Specification

import javax.inject.Named
import javax.inject.Scope
import javax.inject.Singleton
import jakarta.inject.Named
import jakarta.inject.Scope
import jakarta.inject.Singleton
import java.lang.annotation.Documented
import java.lang.annotation.Retention

Expand Down

0 comments on commit 93f83fe

Please sign in to comment.