Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.squareup.javapoet.ClassName;

import java.io.InputStream;
import java.util.List;


Expand Down Expand Up @@ -45,6 +46,7 @@ public class CommonClassNames {

public static final ClassName koraGenerated = ClassName.get("ru.tinkoff.kora.common.annotation", "Generated");
public static final ClassName list = ClassName.get(List.class);
public static final ClassName inputStream = ClassName.get(InputStream.class);

public static final ClassName config = ClassName.get("ru.tinkoff.kora.config.common", "Config");
public static final ClassName configValueExtractor = ClassName.get("ru.tinkoff.kora.config.common.extractor", "ConfigValueExtractor");
Expand Down
16 changes: 16 additions & 0 deletions common/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module kora.common {
requires transitive jakarta.annotation;
requires transitive kora.application.graph;

requires static org.reactivestreams;
requires static reactor.core;
requires static kotlinx.coroutines.core;

exports ru.tinkoff.kora.common;
exports ru.tinkoff.kora.common.annotation;
exports ru.tinkoff.kora.common.readiness;
exports ru.tinkoff.kora.common.naming;
exports ru.tinkoff.kora.common.liveness;
exports ru.tinkoff.kora.common.util;
exports ru.tinkoff.kora.common.util.flow;
}
1 change: 1 addition & 0 deletions common/src/main/java/ru/tinkoff/kora/common/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* <hr>
* <b>English</b>: A special tag type which means that the tag matches any dependency enforcement condition, i.e. it matches any tag
*/
@SuppressWarnings("missing-explicit-ctor")
final class Any {}

Class<?>[] value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

Expand All @@ -12,7 +13,7 @@
* <b>English</b>: Annotation is used to mark source code that has been generated.
*/
@Retention(RUNTIME)
@Target(TYPE)
@Target({TYPE, METHOD})
public @interface Generated {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.squareup.javapoet.*;
import jakarta.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.tinkoff.kora.annotation.processor.common.*;
import ru.tinkoff.kora.common.util.Either;

Expand Down Expand Up @@ -360,7 +358,8 @@ private TypeSpec buildDefaultsType(DeclaredType type, TypeElement typeElement, L
.addOriginatingElement(typeElement)
.addAnnotation(AnnotationUtils.generated(ConfigParserGenerator.class))
.addModifiers(Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL)
.addSuperinterface(type);
.addSuperinterface(type)
.addMethod(MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).build());
for (var tp : typeElement.getTypeParameters()) {
defaults.addTypeVariable(TypeVariableName.get(tp));
}
Expand Down
9 changes: 9 additions & 0 deletions config/config-common/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module kora.config.common {
requires transitive kora.common;

exports ru.tinkoff.kora.config.common;
exports ru.tinkoff.kora.config.common.annotation;
exports ru.tinkoff.kora.config.common.extractor;
exports ru.tinkoff.kora.config.common.factory;
exports ru.tinkoff.kora.config.common.origin;
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ object DbUtils {


fun KSFunctionDeclaration.queryMethodBuilder(resolver: Resolver): FunSpec.Builder {
return overridingKeepAop(resolver);
return overridingKeepAop();
}
}

Expand Down
3 changes: 1 addition & 2 deletions experimental/s3-client-annotation-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ dependencies {

implementation libs.javapoet

testImplementation project(":experimental:s3-client-aws")
testImplementation project(":experimental:s3-client-minio")
testImplementation project(":experimental:s3-client")
testImplementation project(":internal:test-logging")
testImplementation project(":config:config-common")
testImplementation testFixtures(project(":annotation-processor-common"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package ru.tinkoff.kora.s3.client.annotation.processor;

import com.squareup.javapoet.ArrayTypeName;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.TypeName;

import java.io.InputStream;
import java.util.Set;

public class S3ClassNames {

public static class Annotation {
public static final ClassName CLIENT = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "Client");
public static final ClassName BUCKET = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "Bucket");
public static final ClassName GET = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "Get");
public static final ClassName LIST = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "List");
public static final ClassName LIST_LIMIT = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "List", "Limit");
public static final ClassName LIST_DELIMITER = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "List", "Delimiter");
public static final ClassName PUT = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "Put");
public static final ClassName DELETE = ClassName.get("ru.tinkoff.kora.s3.client.annotation", "S3", "Delete");

public static final Set<ClassName> OPERATIONS = Set.of(GET, LIST, PUT, DELETE);
}


public static final ClassName CLIENT = ClassName.get("ru.tinkoff.kora.s3.client", "S3Client");
public static final ClassName CLIENT_FACTORY = ClassName.get("ru.tinkoff.kora.s3.client", "S3ClientFactory");
public static final ClassName S3_BODY = ClassName.get("ru.tinkoff.kora.s3.client.model", "S3Body");
public static final ClassName S3_OBJECT = ClassName.get("ru.tinkoff.kora.s3.client.model", "S3Object");
public static final ClassName S3_OBJECT_META = ClassName.get("ru.tinkoff.kora.s3.client.model", "S3ObjectMeta");
public static final ClassName S3_OBJECT_UPLOAD_RESULT = ClassName.get("ru.tinkoff.kora.s3.client.model", "S3ObjectUploadResult");
public static final Set<TypeName> BODY_TYPES = Set.of(S3_BODY, ArrayTypeName.of(TypeName.BYTE), ClassName.get(InputStream.class));

public static final ClassName RANGE_DATA = ClassName.get("ru.tinkoff.kora.s3.client", "S3Client", "RangeData");
public static final ClassName RANGE_DATA_RANGE = ClassName.get("ru.tinkoff.kora.s3.client", "S3Client", "RangeData", "Range");
public static final ClassName RANGE_DATA_START_FROM = ClassName.get("ru.tinkoff.kora.s3.client", "S3Client", "RangeData", "StartFrom");
public static final ClassName RANGE_DATA_LAST_N = ClassName.get("ru.tinkoff.kora.s3.client", "S3Client", "RangeData", "LastN");
public static final Set<TypeName> RANGE_CLASSES = Set.of(RANGE_DATA, RANGE_DATA_RANGE, RANGE_DATA_START_FROM, RANGE_DATA_LAST_N);
}
Loading