Skip to content

Commit

Permalink
automatic annotation processing (#105)
Browse files Browse the repository at this point in the history
* added no-op remapper to support incremental annotation processing

* moved remappers into separate projects

* fixed license headers, added `annotationProcessor` dependencies into documentation
  • Loading branch information
musketyr committed May 10, 2022
1 parent d2881fe commit 87cbe59
Show file tree
Hide file tree
Showing 28 changed files with 488 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/guide/src/docs/asciidoc/dynamodb.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This library provides two approaches to work with DynamoDB tables and entities:
[source,indent=0,role="primary",subs='verbatim,attributes']
.Gradle (AWS SDK 2.x)
----
annotationProcessor 'com.agorapulse:micronaut-amazon-awssdk-dynamodb-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-amazon-awssdk-dynamodb:{project-version}'
----

Expand All @@ -29,6 +30,7 @@ implementation 'com.agorapulse:micronaut-amazon-awssdk-dynamodb:{project-version
[source,indent=0,role="secondary",subs='verbatim,attributes']
.Gradle (AWS SDK 1.x)
----
annotationProcessor 'com.agorapulse:micronaut-aws-sdk-dynamodb-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-aws-sdk-dynamodb:{project-version}'
----

Expand Down
2 changes: 2 additions & 0 deletions docs/guide/src/docs/asciidoc/kinesis.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This library provides three approaches to work with Kinesis streams:
.Gradle (AWS SDK 2.x)
----
// for Kinesis client
annotationProcessor 'com.agorapulse:micronaut-amazon-awssdk-kinesis-annotation-processor:{project-version
implementation 'com.agorapulse:micronaut-amazon-awssdk-kinesis:{project-version}'
// for Kinesis listener
Expand Down Expand Up @@ -41,6 +42,7 @@ implementation 'com.agorapulse:micronaut-amazon-awssdk-kinesis-worker:{project-v
.Gradle (AWS SDK 1.x)
----
// for Kinesis client
annotationProcessor 'com.agorapulse:micronaut-aws-sdk-kinesis-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-aws-sdk-kinesis:{project-version}'
// for Kinesis listener
implementation 'com.agorapulse:micronaut-aws-sdk-kinesis-worker:{project-version}'
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/src/docs/asciidoc/sns.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This library provides two approaches to work with Simple Notification Service to
[source,indent=0,role="primary",subs='verbatim,attributes']
.Gradle (AWS SDK 2.x)
----
annotationProcessor 'com.agorapulse:micronaut-amazon-awssdk-sns-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-amazon-awssdk-sns:{project-version}'
----

Expand All @@ -28,6 +29,7 @@ implementation 'com.agorapulse:micronaut-amazon-awssdk-sns:{project-version}'
[source,indent=0,role="secondary",subs='verbatim,attributes']
.Gradle (AWS SDK 1.x)
----
annotationProcessor 'com.agorapulse:micronaut-aws-sdk-sns-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-aws-sdk-sns:{project-version}'
----

Expand Down
2 changes: 2 additions & 0 deletions docs/guide/src/docs/asciidoc/sqs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This library provides two approaches to work with Simple Queue Service queues:
[source,indent=0,role="primary",subs='verbatim,attributes']
.Gradle (AWS SDK 2.x)
----
annotationProcessor 'com.agorapulse:micronaut-amazon-awssdk-sqs-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-amazon-awssdk-sqs:{project-version}'
----

Expand All @@ -28,6 +29,7 @@ implementation 'com.agorapulse:micronaut-amazon-awssdk-sqs:{project-version}'
[source,indent=0,role="secondary",subs='verbatim,attributes']
.Gradle (AWS SDK 1.x)
----
annotationProcessor 'com.agorapulse:micronaut-aws-sdk-sqs-annotation-processor:{project-version}'
implementation 'com.agorapulse:micronaut-aws-sdk-sqs:{project-version}'
----

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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 com.agorapulse.micronaut.amazon.awssdk.dynamodb.annotation.remap;

import io.micronaut.core.annotation.AnnotationValue;
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

public class ServiceAnnotationRemapper implements AnnotationRemapper {

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

@Nonnull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
return Collections.singletonList(annotation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.agorapulse.micronaut.amazon.awssdk.dynamodb.annotation.remap.ServiceAnnotationRemapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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 com.agorapulse.micronaut.amazon.awssdk.kinesis.annotation.remap;

import io.micronaut.core.annotation.AnnotationValue;
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

public class KinesisClientRemapper implements AnnotationRemapper {

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

@Nonnull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
return Collections.singletonList(annotation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.agorapulse.micronaut.amazon.awssdk.kinesis.annotation.remap.KinesisClientRemapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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 com.agorapulse.micronaut.amazon.awssdk.sns.annotation.remap;

import io.micronaut.core.annotation.AnnotationValue;
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

public class NotificationClientRemapper implements AnnotationRemapper {

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

@Nonnull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
return Collections.singletonList(annotation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.agorapulse.micronaut.amazon.awssdk.sns.annotation.remap.NotificationClientRemapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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 com.agorapulse.micronaut.amazon.awssdk.sqs.annotation.remap;

import io.micronaut.core.annotation.AnnotationValue;
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

public class QueueClientRemapper implements AnnotationRemapper {

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

@Nonnull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
return Collections.singletonList(annotation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.agorapulse.micronaut.amazon.awssdk.sqs.annotation.remap.QueueClientRemapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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 com.agorapulse.micronaut.aws.dynamodb.annotation.remap;

import io.micronaut.core.annotation.AnnotationValue;
import io.micronaut.inject.annotation.AnnotationRemapper;
import io.micronaut.inject.visitor.VisitorContext;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

public class ServiceAnnotationRemapper implements AnnotationRemapper {

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

@Nonnull
@Override
public List<AnnotationValue<?>> remap(AnnotationValue<?> annotation, VisitorContext visitorContext) {
return Collections.singletonList(annotation);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.agorapulse.micronaut.aws.dynamodb.annotation.remap.ServiceAnnotationRemapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2018-2022 Agorapulse.
*
* 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
*
* 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.
*/

0 comments on commit 87cbe59

Please sign in to comment.