aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed El Khazari <ahmed.el.khazari@qt.io>2025-01-31 16:57:40 +0200
committerVille Voutilainen <ville.voutilainen@qt.io>2025-04-15 07:43:58 +0000
commit599f6d98d26ed7753293bdb81916616c1a8e7c86 (patch)
tree30fedfcc35893965b79f5f9d718f5fcfdd3dbcf8
parent287a5d28e9404e00917441b76b505b2d216fdfd7 (diff)
Remove templates
As the templates have been moved to the compiler. We no longer need them in the examples folders. Task-number: QTTA-271 Change-Id: I8bbe82f7a18166dfd7fa686c2a9b321749d0f720 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
-rw-r--r--sample-android-qt/templates/constructor_definition.kte27
-rw-r--r--sample-android-qt/templates/constructors_ids_declarations.kte17
-rw-r--r--sample-android-qt/templates/constructors_ids_initialisations.kte17
-rw-r--r--sample-android-qt/templates/field_setter.kte30
-rw-r--r--sample-android-qt/templates/fields_ids_declarations.kte17
-rw-r--r--sample-android-qt/templates/fields_ids_initialisations.kte17
-rw-r--r--sample-android-qt/templates/header_final_postamble.kte20
-rw-r--r--sample-android-qt/templates/header_initfunctions.kte17
-rw-r--r--sample-android-qt/templates/header_initvars.kte18
-rw-r--r--sample-android-qt/templates/header_postamble.kte20
-rw-r--r--sample-android-qt/templates/header_preamble.kte46
-rw-r--r--sample-android-qt/templates/initclass_postamble.kte17
-rw-r--r--sample-android-qt/templates/initclass_preamble.kte17
-rw-r--r--sample-android-qt/templates/method_definition.kte36
-rw-r--r--sample-android-qt/templates/method_prologue.kte30
-rw-r--r--sample-android-qt/templates/methods_ids_declarations.kte17
-rw-r--r--sample-android-qt/templates/methods_ids_initialisations.kte17
-rw-r--r--sample-android-qt/templates/param.kte24
-rw-r--r--sample-android/jte_test_templates/first_template.jte5
-rw-r--r--sample-android/jte_test_templates/first_template.kte13
-rw-r--r--sample-android/jte_test_templates/header.kte27
-rw-r--r--sample-android/templates/constructor_definition.kte26
-rw-r--r--sample-android/templates/constructors_ids_declarations.kte23
-rw-r--r--sample-android/templates/constructors_ids_initialisations.kte26
-rw-r--r--sample-android/templates/field_getter.kte30
-rw-r--r--sample-android/templates/field_setter.kte29
-rw-r--r--sample-android/templates/fields_ids_declarations.kte23
-rw-r--r--sample-android/templates/fields_ids_initialisations.kte29
-rw-r--r--sample-android/templates/header_final_postamble.kte18
-rw-r--r--sample-android/templates/header_initfunctions.kte29
-rw-r--r--sample-android/templates/header_initvars.kte30
-rw-r--r--sample-android/templates/header_postamble.kte29
-rw-r--r--sample-android/templates/header_preamble.kte41
-rw-r--r--sample-android/templates/initclass_postamble.kte41
-rw-r--r--sample-android/templates/initclass_preamble.kte41
-rw-r--r--sample-android/templates/method_definition.kte37
-rw-r--r--sample-android/templates/method_prologue.kte30
-rw-r--r--sample-android/templates/methods_ids_declarations.kte23
-rw-r--r--sample-android/templates/methods_ids_initialisations.kte31
-rw-r--r--sample-android/templates/param.kte36
-rw-r--r--templates/constructor_definition.kte12
-rw-r--r--templates/header_initfunctions.kte15
-rw-r--r--templates/header_initvars.kte16
-rw-r--r--templates/header_postamble.kte15
-rw-r--r--templates/header_preamble.kte27
-rw-r--r--templates/method_prologue.kte16
-rw-r--r--templates/param.kte22
47 files changed, 0 insertions, 1144 deletions
diff --git a/sample-android-qt/templates/constructor_definition.kte b/sample-android-qt/templates/constructor_definition.kte
deleted file mode 100644
index ebb14ac..0000000
--- a/sample-android-qt/templates/constructor_definition.kte
+++ /dev/null
@@ -1,27 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param jteData: JteData
-
- // construct: ${jteData.handyHelper.getModifiers(jteData.method!!.method)} ${jteData.simpleClassName}(${jteData.handyHelper.getJavaMethodParam(jteData.method!!.method)})
- static ${jteData.className} newInstance${jteData.method!!.resolvedPostFix}(${jteData.param}) {
- ${jteData.className} ret;
- ret.m_jniObject = QJniObject(FULL_CLASS_NAME, "${jteData.handyHelper.getBinaryMethodSignature(jteData.method!!.method)}"${jteData.handyHelper.getJniMethodParamVal(jteData.clazz!!, jteData.method!!.method, jteData.useJniHelper)});
- return ret;
- }
diff --git a/sample-android-qt/templates/constructors_ids_declarations.kte b/sample-android-qt/templates/constructors_ids_declarations.kte
deleted file mode 100644
index 489cbf2..0000000
--- a/sample-android-qt/templates/constructors_ids_declarations.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-
-@param methodIdDeclaration:MethodIdDeclaration
diff --git a/sample-android-qt/templates/constructors_ids_initialisations.kte b/sample-android-qt/templates/constructors_ids_initialisations.kte
deleted file mode 100644
index 489cbf2..0000000
--- a/sample-android-qt/templates/constructors_ids_initialisations.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-
-@param methodIdDeclaration:MethodIdDeclaration
diff --git a/sample-android-qt/templates/field_setter.kte b/sample-android-qt/templates/field_setter.kte
deleted file mode 100644
index d817164..0000000
--- a/sample-android-qt/templates/field_setter.kte
+++ /dev/null
@@ -1,30 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
- !{val classParam = if (jteData.rawStaticMod != "") "FULL_CLASS_NAME," else ""}
- !{val thizParam = if (jteData.rawStaticMod != "") "QJniObject::" else "m_jniObject."}
- ${jteData.fieldComment}
- ${jteData.rawStaticMod}void set${jteData.fieldCamelCaseName}(${jteData.param}) ${jteData.constMod}{
- ${thizParam}set${jteData.static}Field(${classParam}"${
- jteData.field!!.simpleName.toString()}", ${jteData.fieldSetterParam});
- }
-
-
diff --git a/sample-android-qt/templates/fields_ids_declarations.kte b/sample-android-qt/templates/fields_ids_declarations.kte
deleted file mode 100644
index cbbb9ce..0000000
--- a/sample-android-qt/templates/fields_ids_declarations.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.FieldIdDeclaration
-
-@param fieldIdDeclaration:FieldIdDeclaration
diff --git a/sample-android-qt/templates/fields_ids_initialisations.kte b/sample-android-qt/templates/fields_ids_initialisations.kte
deleted file mode 100644
index cbbb9ce..0000000
--- a/sample-android-qt/templates/fields_ids_initialisations.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.FieldIdDeclaration
-
-@param fieldIdDeclaration:FieldIdDeclaration
diff --git a/sample-android-qt/templates/header_final_postamble.kte b/sample-android-qt/templates/header_final_postamble.kte
deleted file mode 100644
index b03ea60..0000000
--- a/sample-android-qt/templates/header_final_postamble.kte
+++ /dev/null
@@ -1,20 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-@if (jteData.environment.configurations.headerOnlyProxy)#endif // ${jteData.namespaceHelper.fileNamePrefix}${jteData.className}_H@endif \ No newline at end of file
diff --git a/sample-android-qt/templates/header_initfunctions.kte b/sample-android-qt/templates/header_initfunctions.kte
deleted file mode 100644
index bf4ea64..0000000
--- a/sample-android-qt/templates/header_initfunctions.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-
-@param jteData: JteData
diff --git a/sample-android-qt/templates/header_initvars.kte b/sample-android-qt/templates/header_initvars.kte
deleted file mode 100644
index 220f1a0..0000000
--- a/sample-android-qt/templates/header_initvars.kte
+++ /dev/null
@@ -1,18 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
diff --git a/sample-android-qt/templates/header_postamble.kte b/sample-android-qt/templates/header_postamble.kte
deleted file mode 100644
index 7fda829..0000000
--- a/sample-android-qt/templates/header_postamble.kte
+++ /dev/null
@@ -1,20 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-};
-${jteData.namespaceHelper.endNamespace()}
diff --git a/sample-android-qt/templates/header_preamble.kte b/sample-android-qt/templates/header_preamble.kte
deleted file mode 100644
index 786f71f..0000000
--- a/sample-android-qt/templates/header_preamble.kte
+++ /dev/null
@@ -1,46 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-${Constants.AUTO_GENERATE_NOTICE}
-#ifndef ${jteData.namespaceHelper.fileNamePrefix}${jteData.className}_H
-#define ${jteData.namespaceHelper.fileNamePrefix}${jteData.className}_H
-
-#include <QJniObject>
-
-${jteData.namespaceHelper.beginNamespace()}
-class ${jteData.className} {
-private:
- QJniObject m_jniObject;
-public:
- static constexpr auto FULL_CLASS_NAME = "${jteData.slashClassName}";
- QJniObject getJniObject() const {return m_jniObject;}
- const QJniObject* operator->() const {return &m_jniObject;}
- template <class T> operator T() {return m_jniObject.object<T>();}
- ${jteData.className}() {}
- ${jteData.className}(const QJniObject& jniObject) {
- m_jniObject = jniObject;
- }
- ${jteData.className}(jobject globalRef) {
- m_jniObject = QJniObject(globalRef);
- }
- static ${jteData.className} fromLocalRef(jobject localRef) {
- ${jteData.className} res;
- res.m_jniObject = QJniObject::fromLocalRef(localRef);
- return res;
- }
diff --git a/sample-android-qt/templates/initclass_postamble.kte b/sample-android-qt/templates/initclass_postamble.kte
deleted file mode 100644
index bf4ea64..0000000
--- a/sample-android-qt/templates/initclass_postamble.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-
-@param jteData: JteData
diff --git a/sample-android-qt/templates/initclass_preamble.kte b/sample-android-qt/templates/initclass_preamble.kte
deleted file mode 100644
index bf4ea64..0000000
--- a/sample-android-qt/templates/initclass_preamble.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-
-@param jteData: JteData
diff --git a/sample-android-qt/templates/method_definition.kte b/sample-android-qt/templates/method_definition.kte
deleted file mode 100644
index 79427fb..0000000
--- a/sample-android-qt/templates/method_definition.kte
+++ /dev/null
@@ -1,36 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
- !{val classParam = if (jteData.rawStaticMod != "") "FULL_CLASS_NAME," else ""}
- !{val thizParam = if (jteData.rawStaticMod != "") "QJniObject::" else "m_jniObject."}
-
- // method: ${jteData.handyHelper.getModifiers(jteData.method!!.method)} ${jteData.method!!.method.returnType.toString()} ${jteData.method!!.method.simpleName.toString()}(${
- jteData.handyHelper.getJavaMethodParam(
- jteData.method!!.method
- )
- })
- ${jteData.rawStaticMod}auto ${jteData.method!!.method.simpleName.toString()}${jteData.method!!.resolvedPostFix}(${jteData.param}) ${jteData.rawConstMod}{
- ${jteData.returnStatement}${thizParam}call${jteData.static}Method<${jteData.jniReturnType}>(${classParam}
- "${jteData.method!!.method.simpleName.toString()}",
- "${jteData.handyHelper.getBinaryMethodSignature(jteData.method!!.method)}"${jteData.handyHelper.getJniMethodParamVal(jteData.clazz!!, jteData.method!!.method!!, jteData.useJniHelper)});
- }
-
-
diff --git a/sample-android-qt/templates/method_prologue.kte b/sample-android-qt/templates/method_prologue.kte
deleted file mode 100644
index b2b9c13..0000000
--- a/sample-android-qt/templates/method_prologue.kte
+++ /dev/null
@@ -1,30 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param jteData: JteData
-
-@if (jteData.useJniHelper)
- @if (jteData.isStatic)
-::jenny::Env env; assertInited(env.get());
- @else
-::jenny::Env env; ::jenny::LocalRef<jobject> jennyLocalRef = getThis(false); jobject thiz = jennyLocalRef.get();
- @endif
-@else
-assertInited(env);
-@endif \ No newline at end of file
diff --git a/sample-android-qt/templates/methods_ids_declarations.kte b/sample-android-qt/templates/methods_ids_declarations.kte
deleted file mode 100644
index 489cbf2..0000000
--- a/sample-android-qt/templates/methods_ids_declarations.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-
-@param methodIdDeclaration:MethodIdDeclaration
diff --git a/sample-android-qt/templates/methods_ids_initialisations.kte b/sample-android-qt/templates/methods_ids_initialisations.kte
deleted file mode 100644
index 489cbf2..0000000
--- a/sample-android-qt/templates/methods_ids_initialisations.kte
+++ /dev/null
@@ -1,17 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-
-@param methodIdDeclaration:MethodIdDeclaration
diff --git a/sample-android-qt/templates/param.kte b/sample-android-qt/templates/param.kte
deleted file mode 100644
index 9a7c7ba..0000000
--- a/sample-android-qt/templates/param.kte
+++ /dev/null
@@ -1,24 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-@if (!jteData.useJniHelper)
-${jteData.param}
-@else
-${jteData.param}
-@endif \ No newline at end of file
diff --git a/sample-android/jte_test_templates/first_template.jte b/sample-android/jte_test_templates/first_template.jte
deleted file mode 100644
index 5eb5b62..0000000
--- a/sample-android/jte_test_templates/first_template.jte
+++ /dev/null
@@ -1,5 +0,0 @@
-@import io.github.landerlyoung.jenny.NativeProxyGenerator.JteData
-
-@param JteData test
-/* just another comment */
-/* splice the test into a comment, here: ${test.getMCppClassName()} */ \ No newline at end of file
diff --git a/sample-android/jte_test_templates/first_template.kte b/sample-android/jte_test_templates/first_template.kte
deleted file mode 100644
index acf7bf2..0000000
--- a/sample-android/jte_test_templates/first_template.kte
+++ /dev/null
@@ -1,13 +0,0 @@
-@import io.github.landerlyoung.jenny.NativeProxyGenerator.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param test: JteData
-/* just another comment */
-/* splice the test into a comment, here: ${test.mCppClassName} */
-/* We are in namespace ${test.mNamespaceHelper.beginNamespace()} */
-/* ${"""omg interpolation ${test.mCppClassName}"""} */
-/* Constants.AUTO_GENERATE_NOTICE: ${Constants.AUTO_GENERATE_NOTICE} */
-@if (test.mEnv.configurations.threadSafe)
-#include <atomic>
-#include <mutex>
-@endif
diff --git a/sample-android/jte_test_templates/header.kte b/sample-android/jte_test_templates/header.kte
deleted file mode 100644
index 4ee78c3..0000000
--- a/sample-android/jte_test_templates/header.kte
+++ /dev/null
@@ -1,27 +0,0 @@
-@import io.github.landerlyoung.jenny.NativeProxyGenerator.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-${Constants.AUTO_GENERATE_NOTICE}
-#pragma once
-
-#include <jni.h>
-#include <assert.h>
-
-@if (jteData.mEnv.configurations.threadSafe)
-#include <atomic>
-#include <mutex>
-@endif
-
-@if (jteData.mEnv.configurations.useJniHelper)
-#include "jnihelper.h"
-@endif
-
-${jteData.mNamespaceHelper.beginNamespace()}
-class ${jteData.mCppClassName} {
-
-public:
-static constexpr auto FULL_CLASS_NAME = "${jteData.mSlashClassName}";
-
-
diff --git a/sample-android/templates/constructor_definition.kte b/sample-android/templates/constructor_definition.kte
deleted file mode 100644
index 8be47c5..0000000
--- a/sample-android/templates/constructor_definition.kte
+++ /dev/null
@@ -1,26 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param jteData: JteData
-
- // construct: ${jteData.handyHelper.getModifiers(jteData.method!!.method)} ${jteData.simpleClassName}(${jteData.handyHelper.getJavaMethodParam(jteData.method!!.method)})
- static ${jteData.returnType} newInstance${jteData.method!!.resolvedPostFix}(${jteData.param}) {
- ${jteData.methodPrologue}
- return env->NewObject(${jteData.handyHelper.getClassState(jteData.handyHelper.getClazz())}, ${jteData.handyHelper.getClassState(jteData.handyHelper.getConstructorName(jteData.method!!.index))}${jteData.handyHelper.getJniMethodParamVal(jteData.clazz!!, jteData.method!!.method, jteData.useJniHelper)});
- }
diff --git a/sample-android/templates/constructors_ids_declarations.kte b/sample-android/templates/constructors_ids_declarations.kte
deleted file mode 100644
index 12fba87..0000000
--- a/sample-android/templates/constructors_ids_declarations.kte
+++ /dev/null
@@ -1,23 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param methodIdDeclaration:MethodIdDeclaration
-
-@for(method:MethodRecord in methodIdDeclaration.listOfMethods)
- jmethodID ${methodIdDeclaration.helper.getConstructorName(method.index)} = nullptr;
-@endfor \ No newline at end of file
diff --git a/sample-android/templates/constructors_ids_initialisations.kte b/sample-android/templates/constructors_ids_initialisations.kte
deleted file mode 100644
index 7da147c..0000000
--- a/sample-android/templates/constructors_ids_initialisations.kte
+++ /dev/null
@@ -1,26 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param methodIdDeclaration:MethodIdDeclaration
-
-@for(method:MethodRecord in methodIdDeclaration.listOfMethods)
- !{val name = "state."+methodIdDeclaration.helper.getConstructorName(method.index)}
- !{val signature = methodIdDeclaration.helper.getBinaryMethodSignature(method.method)}
- ${name} = env->GetMethodID(state.sClazz, "<init>", "${signature}");
- JENNY_CHECK_NULL(${name});
-@endfor \ No newline at end of file
diff --git a/sample-android/templates/field_getter.kte b/sample-android/templates/field_getter.kte
deleted file mode 100644
index 802262f..0000000
--- a/sample-android/templates/field_getter.kte
+++ /dev/null
@@ -1,30 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
- ${jteData.fieldComment}
- ${jteData.staticMod}${jteData.returnType} get${jteData.fieldCamelCaseName}(${jteData.param}) ${jteData.constMod}{
- ${jteData.methodPrologue}
- return ${jteData.wrapLocalRef}${jteData.returnTypeCast}env->Get${jteData.static}${jteData.handyHelper.getTypeForJniCall(jteData.field!!.asType())}Field(${jteData.classOrObj}, ${
- jteData.handyHelper.getClassState(jteData.fieldId)
- })${jteData.callExpressionClosing}
-
- }
-
diff --git a/sample-android/templates/field_setter.kte b/sample-android/templates/field_setter.kte
deleted file mode 100644
index dc913e4..0000000
--- a/sample-android/templates/field_setter.kte
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
- ${jteData.fieldComment}
- ${jteData.staticMod}void set${jteData.fieldCamelCaseName}(${jteData.param}) ${jteData.constMod}{
- ${jteData.methodPrologue}
- env->Set${jteData.static}${jteData.handyHelper.getTypeForJniCall(jteData.field!!.asType())}Field(${jteData.classOrObj}, ${
- jteData.handyHelper.getClassState(jteData.fieldId)}, ${jteData.fieldSetterParam});
- }
-
-
diff --git a/sample-android/templates/fields_ids_declarations.kte b/sample-android/templates/fields_ids_declarations.kte
deleted file mode 100644
index 2db4bc7..0000000
--- a/sample-android/templates/fields_ids_declarations.kte
+++ /dev/null
@@ -1,23 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.FieldIdDeclaration
-@import io.github.landerlyoung.jenny.HandyHelper
-@import javax.lang.model.element.VariableElement
-
-@param fieldIdDeclaration:FieldIdDeclaration
-
-@for((index, fieldElement) in fieldIdDeclaration.listOfFields.withIndex())
- jfieldID ${fieldIdDeclaration.helper.getFieldName(fieldElement, index)} = nullptr;
-@endfor \ No newline at end of file
diff --git a/sample-android/templates/fields_ids_initialisations.kte b/sample-android/templates/fields_ids_initialisations.kte
deleted file mode 100644
index 5da3ae7..0000000
--- a/sample-android/templates/fields_ids_initialisations.kte
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.FieldIdDeclaration
-@import io.github.landerlyoung.jenny.HandyHelper
-@import javax.lang.model.element.VariableElement
-@import javax.lang.model.element.Modifier
-
-@param fieldIdDeclaration:FieldIdDeclaration
-
-@for((index, fieldElement) in fieldIdDeclaration.listOfFields.withIndex())
- !{val name = "state."+fieldIdDeclaration.helper.getFieldName(fieldElement, index)}
- !{val static = if (fieldElement.modifiers.contains(Modifier.STATIC)) "Static" else ""}
- !{val methodName = fieldElement.simpleName.toString()}
- !{val signature = fieldIdDeclaration.helper.getBinaryTypeSignature(fieldElement.asType())}
- ${name} = env->Get${static}FieldID(state.sClazz, "${methodName}", "${signature}");
- JENNY_CHECK_NULL(${name});
-@endfor \ No newline at end of file
diff --git a/sample-android/templates/header_final_postamble.kte b/sample-android/templates/header_final_postamble.kte
deleted file mode 100644
index 220f1a0..0000000
--- a/sample-android/templates/header_final_postamble.kte
+++ /dev/null
@@ -1,18 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
diff --git a/sample-android/templates/header_initfunctions.kte b/sample-android/templates/header_initfunctions.kte
deleted file mode 100644
index 5800dd4..0000000
--- a/sample-android/templates/header_initfunctions.kte
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-public:
-
- static bool initClazz(JNIEnv* env);
-
- static void releaseClazz(JNIEnv* env);
-
- static void assertInited(JNIEnv* env) {
- auto initClazzSuccess = initClazz(env);
- assert(initClazzSuccess);
- }
diff --git a/sample-android/templates/header_initvars.kte b/sample-android/templates/header_initvars.kte
deleted file mode 100644
index 7052366..0000000
--- a/sample-android/templates/header_initvars.kte
+++ /dev/null
@@ -1,30 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-private:
- struct ClassInitState {
-
-@if (jteData.environment.configurations.threadSafe)
- // thread safe init
- std::atomic_bool sInited {};
- std::mutex sInitLock {};
-@else
- bool sInited = false;\n")
-@endif
- jclass sClazz = nullptr;
diff --git a/sample-android/templates/header_postamble.kte b/sample-android/templates/header_postamble.kte
deleted file mode 100644
index aa38040..0000000
--- a/sample-android/templates/header_postamble.kte
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-
- }; // endof struct ClassInitState
-
- static inline ClassInitState& getClassInitState() {
- static ClassInitState classInitState;
- return classInitState;
- }
-};
-${jteData.namespaceHelper.endNamespace()}
-
diff --git a/sample-android/templates/header_preamble.kte b/sample-android/templates/header_preamble.kte
deleted file mode 100644
index 97e3696..0000000
--- a/sample-android/templates/header_preamble.kte
+++ /dev/null
@@ -1,41 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-${Constants.AUTO_GENERATE_NOTICE}
-#pragma once
-
-#include <jni.h>
-#include <assert.h>
-
-@if (jteData.environment.configurations.threadSafe)
-#include <atomic>
-#include <mutex>
-@endif
-
-@if (jteData.environment.configurations.useJniHelper)
-#include "jnihelper.h"
-@endif
-
-${jteData.namespaceHelper.beginNamespace()}
-class ${jteData.className} {
-
-public:
- static constexpr auto FULL_CLASS_NAME = "${jteData.slashClassName}";
-
-
diff --git a/sample-android/templates/initclass_postamble.kte b/sample-android/templates/initclass_postamble.kte
deleted file mode 100644
index 5183f5b..0000000
--- a/sample-android/templates/initclass_postamble.kte
+++ /dev/null
@@ -1,41 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
- state.sInited = true;
- }
-@if (jteData.environment.configurations.threadSafe)
- }
-@endif
-#undef JENNY_CHECK_NULL
- return true;
-}
-
-${jteData.initClassPrefix} void ${jteData.className}::releaseClazz(JNIEnv* env) {
- auto& state = getClassInitState();
- if (state.sInited) {
- ${jteData.initClassLockGuard}
- if (state.sInited) {
- env->DeleteGlobalRef(state.sClazz);
- state.sClazz = nullptr;
- state.sInited = false;
- }
- }
-}
diff --git a/sample-android/templates/initclass_preamble.kte b/sample-android/templates/initclass_preamble.kte
deleted file mode 100644
index 20619c1..0000000
--- a/sample-android/templates/initclass_preamble.kte
+++ /dev/null
@@ -1,41 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
-${jteData.initClassPrefix} bool ${jteData.className}::initClazz(JNIEnv* env) {
-#define JENNY_CHECK_NULL(val) \
- do { \
- if ((val) == nullptr) { \
-@if (!jteData.environment.configurations.errorLoggerFunction.isNullOrBlank()) ${jteData.environment.configurations.errorLoggerFunction}(env, "can't init ${jteData.className}::" #val); \@else env->ExceptionDescribe(); \@endif
- return false; \
- } \
- } while(false)
-
- auto& state = getClassInitState();
-@if (jteData.environment.configurations.threadSafe)
- if (!state.sInited) {
- std::lock_guard<std::mutex> lg(state.sInitLock);
-@endif
- if (!state.sInited) {
- auto clazz = env->FindClass(FULL_CLASS_NAME);
- JENNY_CHECK_NULL(clazz);
- state.sClazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz));
- env->DeleteLocalRef(clazz);
- JENNY_CHECK_NULL(state.sClazz); \ No newline at end of file
diff --git a/sample-android/templates/method_definition.kte b/sample-android/templates/method_definition.kte
deleted file mode 100644
index 549b207..0000000
--- a/sample-android/templates/method_definition.kte
+++ /dev/null
@@ -1,37 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.type.TypeKind
-
-@param jteData: JteData
-@if (jteData.useJniHelper)
- // for jni helper
-@endif
- // method: ${jteData.handyHelper.getModifiers(jteData.method!!.method)} ${jteData.method!!.method.returnType.toString()} ${jteData.method!!.method.simpleName.toString()}(${
- jteData.handyHelper.getJavaMethodParam(
- jteData.method!!.method
- )
- })
- ${jteData.staticMod}${jteData.returnType} ${jteData.method!!.method.simpleName.toString()}${jteData.method!!.resolvedPostFix}(${jteData.param}) ${jteData.constMod}{
- ${jteData.methodPrologue}
- ${jteData.returnStatement}${jteData.wrapLocalRef}${jteData.returnTypeCast}env->Call${jteData.static}${jteData.handyHelper.getTypeForJniCall(jteData.method!!.method.returnType)}Method(${jteData.classOrObj}, ${
- jteData.handyHelper.getClassState(jteData.handyHelper.getMethodName(jteData.method!!.method, jteData.method!!.index))
- }${jteData.handyHelper.getJniMethodParamVal(jteData.clazz!!, jteData.method!!.method!!, jteData.useJniHelper)})${jteData.callExpressionClosing}
- }
-
-
diff --git a/sample-android/templates/method_prologue.kte b/sample-android/templates/method_prologue.kte
deleted file mode 100644
index b2b9c13..0000000
--- a/sample-android/templates/method_prologue.kte
+++ /dev/null
@@ -1,30 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param jteData: JteData
-
-@if (jteData.useJniHelper)
- @if (jteData.isStatic)
-::jenny::Env env; assertInited(env.get());
- @else
-::jenny::Env env; ::jenny::LocalRef<jobject> jennyLocalRef = getThis(false); jobject thiz = jennyLocalRef.get();
- @endif
-@else
-assertInited(env);
-@endif \ No newline at end of file
diff --git a/sample-android/templates/methods_ids_declarations.kte b/sample-android/templates/methods_ids_declarations.kte
deleted file mode 100644
index ab39daf..0000000
--- a/sample-android/templates/methods_ids_declarations.kte
+++ /dev/null
@@ -1,23 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param methodIdDeclaration:MethodIdDeclaration
-
-@for(method:MethodRecord in methodIdDeclaration.listOfMethods)
- jmethodID ${methodIdDeclaration.helper.getMethodName(method.method , method.index)} = nullptr;
-@endfor \ No newline at end of file
diff --git a/sample-android/templates/methods_ids_initialisations.kte b/sample-android/templates/methods_ids_initialisations.kte
deleted file mode 100644
index c6722cf..0000000
--- a/sample-android/templates/methods_ids_initialisations.kte
+++ /dev/null
@@ -1,31 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.MethodIdDeclaration
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-@import javax.lang.model.element.Modifier
-@import javax.lang.model.element.Name
-
-@param methodIdDeclaration:MethodIdDeclaration
-
-@for(method:MethodRecord in methodIdDeclaration.listOfMethods)
- !{val m = method.method}
- !{val name = "state."+ methodIdDeclaration.helper.getMethodName(m , method.index)}
- !{val static = if (m.modifiers.contains(Modifier.STATIC)) "Static" else ""}
- !{val methodName = m.simpleName.toString()}
- !{val signature = methodIdDeclaration.helper.getBinaryMethodSignature(m)}
- ${name} = env->Get${static}MethodID(state.sClazz, "${methodName}", "${signature}");
- JENNY_CHECK_NULL(${name});
-@endfor \ No newline at end of file
diff --git a/sample-android/templates/param.kte b/sample-android/templates/param.kte
deleted file mode 100644
index 14789f6..0000000
--- a/sample-android/templates/param.kte
+++ /dev/null
@@ -1,36 +0,0 @@
-<%--
- Copyright (C) 2024 The Qt Company Ltd.
-
- 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
- http://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.
---%>
-
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-@if (!jteData.useJniHelper)
- @if (jteData.isStatic)
- @if (jteData.param != "")
-JNIEnv* env, ${jteData.param}
- @else
-JNIEnv* env
- @endif
- @else
- @if (jteData.param != "")
-JNIEnv* env, jobject thiz, ${jteData.param}
- @else
-JNIEnv* env, jobject thiz
- @endif
- @endif
-@else
-${jteData.param}
-@endif \ No newline at end of file
diff --git a/templates/constructor_definition.kte b/templates/constructor_definition.kte
deleted file mode 100644
index 32ba70d..0000000
--- a/templates/constructor_definition.kte
+++ /dev/null
@@ -1,12 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param jteData: JteData
-
- // construct: ${jteData.mHelper.getModifiers(jteData.method!!.method)} ${jteData.mSimpleClassName}(${jteData.mHelper.getJavaMethodParam(jteData.method!!.method)})
- static ${jteData.returnType} newInstance${jteData.method!!.resolvedPostFix}(${jteData.param}) {
- ${jteData.methodPrologue}
- return env->NewObject(${jteData.mHelper.getClassState(jteData.mHelper.getClazz())}, ${jteData.mHelper.getClassState(jteData.mHelper.getConstructorName(jteData.method!!.index))}${jteData.mHelper.getJniMethodParamVal(jteData.clazz!!, jteData.method!!.method, jteData.useJniHelper)});
- }
diff --git a/templates/header_initfunctions.kte b/templates/header_initfunctions.kte
deleted file mode 100644
index 4949f36..0000000
--- a/templates/header_initfunctions.kte
+++ /dev/null
@@ -1,15 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-public:
-
- static bool initClazz(JNIEnv* env);
-
- static void releaseClazz(JNIEnv* env);
-
- static void assertInited(JNIEnv* env) {
- auto initClazzSuccess = initClazz(env);
- assert(initClazzSuccess);
- }
diff --git a/templates/header_initvars.kte b/templates/header_initvars.kte
deleted file mode 100644
index fe6769c..0000000
--- a/templates/header_initvars.kte
+++ /dev/null
@@ -1,16 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-private:
- struct ClassInitState {
-
-@if (jteData.mEnv.configurations.threadSafe)
- // thread safe init
- std::atomic_bool sInited {};
- std::mutex sInitLock {};
-@else
- bool sInited = false;\n")
-@endif
- jclass sClazz = nullptr;
diff --git a/templates/header_postamble.kte b/templates/header_postamble.kte
deleted file mode 100644
index d3c5480..0000000
--- a/templates/header_postamble.kte
+++ /dev/null
@@ -1,15 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-
- }; // endof struct ClassInitState
-
- static inline ClassInitState& getClassInitState() {
- static ClassInitState classInitState;
- return classInitState;
- }
-};
-${jteData.mNamespaceHelper.endNamespace()}
-
diff --git a/templates/header_preamble.kte b/templates/header_preamble.kte
deleted file mode 100644
index c731c3b..0000000
--- a/templates/header_preamble.kte
+++ /dev/null
@@ -1,27 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-${Constants.AUTO_GENERATE_NOTICE}
-#pragma once
-
-#include <jni.h>
-#include <assert.h>
-
-@if (jteData.mEnv.configurations.threadSafe)
-#include <atomic>
-#include <mutex>
-@endif
-
-@if (jteData.mEnv.configurations.useJniHelper)
-#include "jnihelper.h"
-@endif
-
-${jteData.mNamespaceHelper.beginNamespace()}
-class ${jteData.mCppClassName} {
-
-public:
- static constexpr auto FULL_CLASS_NAME = "${jteData.mSlashClassName}";
-
-
diff --git a/templates/method_prologue.kte b/templates/method_prologue.kte
deleted file mode 100644
index 8e28bf8..0000000
--- a/templates/method_prologue.kte
+++ /dev/null
@@ -1,16 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-@import io.github.landerlyoung.jenny.HandyHelper
-@import io.github.landerlyoung.jenny.MethodOverloadResolver.MethodRecord
-
-@param jteData: JteData
-
-@if (jteData.useJniHelper)
- @if (jteData.isStatic)
-::jenny::Env env; assertInited(env.get());
- @else
-::jenny::Env env; ::jenny::LocalRef<jobject> jennyLocalRef = getThis(false); jobject thiz = jennyLocalRef.get();
- @endif
-@else
-assertInited(env);
-@endif \ No newline at end of file
diff --git a/templates/param.kte b/templates/param.kte
deleted file mode 100644
index e788593..0000000
--- a/templates/param.kte
+++ /dev/null
@@ -1,22 +0,0 @@
-@import io.github.landerlyoung.jenny.JteData
-@import io.github.landerlyoung.jenny.Constants
-
-@param jteData: JteData
-
-@if (!jteData.useJniHelper)
- @if (jteData.isStatic)
- @if (jteData.param != "")
-JNIEnv* env, ${jteData.param}
- @else
-JNIEnv* env
- @endif
- @else
- @if (jteData.param != "")
-JNIEnv* env, jobject thiz, ${jteData.param}
- @else
-JNIEnv* env, jobject thiz
- @endif
- @endif
-@else
-${jteData.param}
-@endif \ No newline at end of file