From ae831ed982645aedc4cde9ed9b25a27aa25c11c6 Mon Sep 17 00:00:00 2001 From: Dmitrii Tikhomirov Date: Fri, 27 Dec 2024 10:22:45 -0800 Subject: [PATCH] release 0.8 --- annotations/pom.xml | 2 +- bom/pom.xml | 2 +- core/pom.xml | 6 +----- demo/pom.xml | 8 ++++---- internal-bom/pom.xml | 20 +++++++------------ pom.xml | 2 +- processor/pom.xml | 2 +- .../generator/ManagedBeanGenerator.java | 2 +- .../helpers/MethodCallGenerator.java | 4 ++-- .../io/crysknife/util/GenerationUtils.java | 9 ++++----- tests/j2cl-tests/pom.xml | 2 +- tests/jre-tests/cdi/pom.xml | 2 +- tests/jre-tests/pom.xml | 2 +- tests/jre-tests/reduces-classpath/app/pom.xml | 2 +- tests/jre-tests/reduces-classpath/dep/pom.xml | 2 +- tests/jre-tests/reduces-classpath/pom.xml | 2 +- tests/jre-tests/simple/pom.xml | 2 +- tests/pom.xml | 4 ++-- ui/core/pom.xml | 2 +- ui/generator/pom.xml | 2 +- .../generator/TemplateGenerator.java | 9 ++++----- ui/pom.xml | 2 +- 22 files changed, 39 insertions(+), 51 deletions(-) diff --git a/annotations/pom.xml b/annotations/pom.xml index b2aa9d5b..38f7a4b0 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -4,7 +4,7 @@ io.crysknife crysknife-parent - 0.7 + 0.8 crysknife-annotations diff --git a/bom/pom.xml b/bom/pom.xml index 441a067d..9305164c 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -6,7 +6,7 @@ io.crysknife bom - 0.7 + 0.8 pom diff --git a/core/pom.xml b/core/pom.xml index 0c3388ea..dcd2ba65 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ io.crysknife crysknife-parent - 0.7 + 0.8 crysknife-core @@ -36,10 +36,6 @@ - - com.google.jsinterop - jsinterop-annotations - io.crysknife crysknife-annotations diff --git a/demo/pom.xml b/demo/pom.xml index a5883783..4d94675d 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -5,7 +5,7 @@ io.crysknife.demo demo - 0.7 + 0.8 jar @@ -15,9 +15,9 @@ 11 11 - 1.2.1 - 0.23.1 - 0.7 + 1.2.3 + 0.23.2 + 0.8 diff --git a/internal-bom/pom.xml b/internal-bom/pom.xml index bc775354..6daa7466 100644 --- a/internal-bom/pom.xml +++ b/internal-bom/pom.xml @@ -6,7 +6,7 @@ io.crysknife internal-bom - 0.7 + 0.8 pom @@ -71,18 +71,17 @@ 1 2.3.30 1.10 - 2.0.0 28.1-jre 4.8.156 - 0.7 - 0.4 + 0.8 + 0.6 3.25.5 - 1.2.1 - 1.2.1 - 1.0-rc7 + 1.2.3 + 1.2.2 + 1.1.1 4.6.1 - 4.13.1 + 4.13.2 @@ -100,11 +99,6 @@ ${javax.inject.version} provided - - com.google.jsinterop - jsinterop-annotations - ${google.jsinterop.annotations.version} - com.google.elemental2 elemental2-dom diff --git a/pom.xml b/pom.xml index c6926f4c..5fd05205 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.crysknife crysknife-parent - 0.7 + 0.8 pom crysknife parent diff --git a/processor/pom.xml b/processor/pom.xml index fda52103..7016fc5f 100644 --- a/processor/pom.xml +++ b/processor/pom.xml @@ -5,7 +5,7 @@ io.crysknife crysknife-parent - 0.7 + 0.8 crysknife-processor diff --git a/processor/src/main/java/io/crysknife/generator/ManagedBeanGenerator.java b/processor/src/main/java/io/crysknife/generator/ManagedBeanGenerator.java index b1f01246..8bd6d130 100644 --- a/processor/src/main/java/io/crysknife/generator/ManagedBeanGenerator.java +++ b/processor/src/main/java/io/crysknife/generator/ManagedBeanGenerator.java @@ -154,7 +154,7 @@ private void privateMethods(BeanDefinition beanDefinition, ClassMetaInfo classMe .methodsIn(MoreTypes.asTypeElement(beanDefinition.getType()).getEnclosedElements()) .stream().filter(method -> method.getModifiers().contains(Modifier.PRIVATE)) .filter(method -> !method.getModifiers().contains(Modifier.NATIVE)) - .map(method -> j2CLUtils.createDeclarationMethodDescriptor(method).getMangledName()) + .map(j2CLUtils::getMethodMangledName) .collect(Collectors.toSet()); if (!methods.isEmpty()) { classMetaInfo.addImport(JsType.class); diff --git a/processor/src/main/java/io/crysknife/generator/helpers/MethodCallGenerator.java b/processor/src/main/java/io/crysknife/generator/helpers/MethodCallGenerator.java index 65d9e772..871fea6a 100644 --- a/processor/src/main/java/io/crysknife/generator/helpers/MethodCallGenerator.java +++ b/processor/src/main/java/io/crysknife/generator/helpers/MethodCallGenerator.java @@ -54,11 +54,11 @@ public String generate(TypeMirror parent, ExecutableElement method, List if (isJre) { root.put("name", method.getSimpleName().toString()); if (!args.isEmpty()) { - root.put("args", args.stream().collect(Collectors.joining(", "))); + root.put("args", String.join(", ", args)); } } else { if (isPrivate) { - root.put("name", j2CLUtils.createDeclarationMethodDescriptor(method).getMangledName()); + root.put("name", j2CLUtils.getMethodMangledName(method)); } else { root.put("name", method.getSimpleName().toString()); } diff --git a/processor/src/main/java/io/crysknife/util/GenerationUtils.java b/processor/src/main/java/io/crysknife/util/GenerationUtils.java index 963338a5..878255d5 100644 --- a/processor/src/main/java/io/crysknife/util/GenerationUtils.java +++ b/processor/src/main/java/io/crysknife/util/GenerationUtils.java @@ -125,7 +125,7 @@ public Expression getFieldAccessCallExpr(BeanDefinition beanDefinition, Variable "get").addArgument( new MethodCallExpr(new NameExpr(Reflect.class.getSimpleName()), "objectProperty") .addArgument( - new StringLiteralExpr(j2CLUtils.createFieldDescriptor(field).getMangledName())) + new StringLiteralExpr(j2CLUtils.getVariableMangledName(field))) .addArgument("instance")); } @@ -228,8 +228,7 @@ public Statement generateMethodCall(TypeMirror parent, ExecutableElement method, new MethodCallExpr(new NameExpr(Reflect.class.getCanonicalName()), "objectProperty") .addArgument(new StringLiteralExpr( - j2CLUtils.createDeclarationMethodDescriptor(method) - .getMangledName())) + j2CLUtils.getMethodMangledName(method))) .addArgument("instance"))), "bind").addArgument("instance"); @@ -282,7 +281,7 @@ private TryStmt generatePrivateJREMethodCall(ExecutableElement method, Expressio } private Statement generatePrivateJ2CLMethodCall(ExecutableElement method, Expression[] args) { - String mangleName = j2CLUtils.createDeclarationMethodDescriptor(method).getMangledName(); + String mangleName = j2CLUtils.getMethodMangledName(method); TypeMirror parent = context.getGenerationContext().getTypes().erasure(method.getEnclosingElement().asType()); String factoryName = TypeUtils.getQualifiedFactoryName(parent); @@ -341,7 +340,7 @@ public Expression getFieldAccessorExpression(InjectableVariableDefinition fieldP } String jsFieldName = - j2CLUtils.createFieldDescriptor(fieldPoint.getVariableElement()).getMangledName(); + j2CLUtils.getVariableMangledName(fieldPoint.getVariableElement()); MethodCallExpr reflect = new MethodCallExpr(new NameExpr(Reflect.class.getSimpleName()), "objectProperty") .addArgument(new StringLiteralExpr(jsFieldName)) diff --git a/tests/j2cl-tests/pom.xml b/tests/j2cl-tests/pom.xml index 1c267672..182d28c2 100644 --- a/tests/j2cl-tests/pom.xml +++ b/tests/j2cl-tests/pom.xml @@ -6,7 +6,7 @@ io.crysknife.tests j2cl-tests - 0.7 + 0.8 J2CL tests diff --git a/tests/jre-tests/cdi/pom.xml b/tests/jre-tests/cdi/pom.xml index 341fd819..028671e7 100644 --- a/tests/jre-tests/cdi/pom.xml +++ b/tests/jre-tests/cdi/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.crysknife.tests jre-cdi-tests - 0.7 + 0.8 jar diff --git a/tests/jre-tests/pom.xml b/tests/jre-tests/pom.xml index 117214c8..2b9e5bec 100644 --- a/tests/jre-tests/pom.xml +++ b/tests/jre-tests/pom.xml @@ -4,7 +4,7 @@ 4.0.0 jre-parent io.crysknife.tests - 0.7 + 0.8 pom Crysknife :: Tests :: JRE diff --git a/tests/jre-tests/reduces-classpath/app/pom.xml b/tests/jre-tests/reduces-classpath/app/pom.xml index f37adc08..6152b7e3 100644 --- a/tests/jre-tests/reduces-classpath/app/pom.xml +++ b/tests/jre-tests/reduces-classpath/app/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.crysknife.tests reduces-classpath-app - 0.7 + 0.8 jar diff --git a/tests/jre-tests/reduces-classpath/dep/pom.xml b/tests/jre-tests/reduces-classpath/dep/pom.xml index 5247fbef..1bc332a2 100644 --- a/tests/jre-tests/reduces-classpath/dep/pom.xml +++ b/tests/jre-tests/reduces-classpath/dep/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.crysknife.tests reduces-classpath-dep - 0.7 + 0.8 jar diff --git a/tests/jre-tests/reduces-classpath/pom.xml b/tests/jre-tests/reduces-classpath/pom.xml index e31edb25..dcfa6dda 100644 --- a/tests/jre-tests/reduces-classpath/pom.xml +++ b/tests/jre-tests/reduces-classpath/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.crysknife reduces-classpath-parent - 0.7 + 0.8 pom diff --git a/tests/jre-tests/simple/pom.xml b/tests/jre-tests/simple/pom.xml index 34f4f0fa..d65cc353 100644 --- a/tests/jre-tests/simple/pom.xml +++ b/tests/jre-tests/simple/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.crysknife.tests jre-simple-tests - 0.7 + 0.8 jar diff --git a/tests/pom.xml b/tests/pom.xml index 0f3c9e9f..1fbd1fef 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -5,12 +5,12 @@ io.crysknife crysknife-parent - 0.7 + 0.8 tests-parent io.crysknife.tests - 0.7 + 0.8 pom diff --git a/ui/core/pom.xml b/ui/core/pom.xml index 559d6727..092cf956 100644 --- a/ui/core/pom.xml +++ b/ui/core/pom.xml @@ -5,7 +5,7 @@ io.crysknife.ui parent - 0.7 + 0.8 crysknife-ui-core diff --git a/ui/generator/pom.xml b/ui/generator/pom.xml index aef7cdd2..6344da1c 100644 --- a/ui/generator/pom.xml +++ b/ui/generator/pom.xml @@ -5,7 +5,7 @@ io.crysknife.ui parent - 0.7 + 0.8 crysknife-ui-generator diff --git a/ui/generator/src/main/java/io/crysknife/ui/templates/generator/TemplateGenerator.java b/ui/generator/src/main/java/io/crysknife/ui/templates/generator/TemplateGenerator.java index 41a0557b..e5709a06 100644 --- a/ui/generator/src/main/java/io/crysknife/ui/templates/generator/TemplateGenerator.java +++ b/ui/generator/src/main/java/io/crysknife/ui/templates/generator/TemplateGenerator.java @@ -178,7 +178,7 @@ private void maybeHasNotGetMethod(BeanDefinition beanDefinition, if (executableElement.isPresent()) { templateDefinition.setInitRootElement(true); String mangledName = - j2CLUtils.createDeclarationMethodDescriptor(executableElement.get()).getMangledName(); + j2CLUtils.getMethodMangledName(executableElement.get()); templateDefinition.setRootElementPropertyName(mangledName); } } @@ -280,7 +280,7 @@ private void processDataFields(TemplateContext templateContext, "resolveElement").addArgument(instance) .addArgument(new StringLiteralExpr(element.getName())); } - String mangleName = j2CLUtils.createFieldDescriptor(element.getField()).getMangledName(); + String mangleName = j2CLUtils.getVariableMangledName(element.getField()); MethodCallExpr fieldSetCallExpr = new MethodCallExpr( new MethodCallExpr(new NameExpr(Js.class.getSimpleName()), "asPropertyMap") @@ -321,8 +321,7 @@ private void processEventHandlers(BeanDefinition beanDefinition, TemplateContext .getAnnotation(ForEvent.class).value(); String clazz = iocContext.getGenerationContext().getTypes() .erasure(eventHandlerInfo.getMethod().getParameters().get(0).asType()).toString(); - String mangleName = j2CLUtils.createFieldDescriptor(eventHandlerInfo.getInfo().getField(), - beanDefinition.getType()).getMangledName(); + String mangleName = j2CLUtils.getVariableMangledName(eventHandlerInfo.getInfo().getField()); String call = methodCallGenerator.generate(beanDefinition.getType(), eventHandlerInfo.getMethod(), List.of("e")); Event event = new Event(eventTypes, mangleName, clazz, call); @@ -530,7 +529,7 @@ public MethodCallExpr getFieldAccessCallExpr(DataElementInfo info) { } public MethodCallExpr getFieldAccessCallExpr(VariableElement field) { - String mangleName = j2CLUtils.createFieldDescriptor(field).getMangledName(); + String mangleName = j2CLUtils.getVariableMangledName(field); return new MethodCallExpr( new MethodCallExpr(new NameExpr(Js.class.getSimpleName()), "asPropertyMap") diff --git a/ui/pom.xml b/ui/pom.xml index 887ada9c..83863f8d 100644 --- a/ui/pom.xml +++ b/ui/pom.xml @@ -5,7 +5,7 @@ io.crysknife crysknife-parent - 0.7 + 0.8 io.crysknife.ui