diff options
Diffstat (limited to 'examples/11-native-type-generic')
13 files changed, 0 insertions, 99 deletions
diff --git a/examples/11-native-type-generic/hobgoblin.json5 b/examples/11-native-type-generic/hobgoblin.json5 deleted file mode 100644 index ca81993..0000000 --- a/examples/11-native-type-generic/hobgoblin.json5 +++ /dev/null @@ -1,33 +0,0 @@ -{ - outputs: { - langs: { - java: { - packageName: "org.zwobble.example.types", - nativeTypes: [ - { - hobgoblin: "map.NativeMap", - java: "java.util.Map", - }, - ], - }, - rust: { - nativeTypes: [ - { - hobgoblin: "map.NativeMap", - rust: "::std::collections::BTreeMap", - }, - ], - }, - }, - generators: [ - { - generator: "java-types", - path: "output/java/src/gen/java", - }, - { - generator: "rust-types", - path: "output/rust/src/gen", - }, - ], - }, -} diff --git a/examples/11-native-type-generic/output/java/.gitignore b/examples/11-native-type-generic/output/java/.gitignore deleted file mode 100644 index ff511d4..0000000 --- a/examples/11-native-type-generic/output/java/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/src/gen/ -/target/ diff --git a/examples/11-native-type-generic/output/java/pom.xml b/examples/11-native-type-generic/output/java/pom.xml deleted file mode 120000 index 445fa65..0000000 --- a/examples/11-native-type-generic/output/java/pom.xml +++ /dev/null @@ -1 +0,0 @@ -../../../templates/java-junit/pom.xml
\ No newline at end of file diff --git a/examples/11-native-type-generic/output/java/src/main/java/org/zwobble/example/types/map/HobgoblinNativeMap.java b/examples/11-native-type-generic/output/java/src/main/java/org/zwobble/example/types/map/HobgoblinNativeMap.java deleted file mode 100644 index 309ba0b..0000000 --- a/examples/11-native-type-generic/output/java/src/main/java/org/zwobble/example/types/map/HobgoblinNativeMap.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.zwobble.example.types.map; - -public class HobgoblinNativeMap { - private HobgoblinNativeMap() {} - - public static <K, V> java.util.Map<K, V> arbitraryNativeMap() { - return new java.util.HashMap<>(); - } -} diff --git a/examples/11-native-type-generic/output/java/src/test/java/org/zwobble/example/MapTests.java b/examples/11-native-type-generic/output/java/src/test/java/org/zwobble/example/MapTests.java deleted file mode 100644 index 5b6a764..0000000 --- a/examples/11-native-type-generic/output/java/src/test/java/org/zwobble/example/MapTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.zwobble.example; - -import java.util.Map; -import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.Test; -import org.zwobble.example.types.map.X; - -public class MapTests { - @Test - public void canUseGenericNativeTypes() { - var x = new X(Map.ofEntries(Map.entry("a", 1), Map.entry("b", 2))); - } -} diff --git a/examples/11-native-type-generic/output/rust/.gitignore b/examples/11-native-type-generic/output/rust/.gitignore deleted file mode 100644 index ea8c4bf..0000000 --- a/examples/11-native-type-generic/output/rust/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/examples/11-native-type-generic/output/rust/Cargo.lock b/examples/11-native-type-generic/output/rust/Cargo.lock deleted file mode 100644 index 9dc6e3e..0000000 --- a/examples/11-native-type-generic/output/rust/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "example" -version = "0.1.0" diff --git a/examples/11-native-type-generic/output/rust/Cargo.toml b/examples/11-native-type-generic/output/rust/Cargo.toml deleted file mode 100644 index 5d4c622..0000000 --- a/examples/11-native-type-generic/output/rust/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "example" -version = "0.1.0" -edition = "2024" - -[dependencies] diff --git a/examples/11-native-type-generic/output/rust/rust-toolchain.toml b/examples/11-native-type-generic/output/rust/rust-toolchain.toml deleted file mode 100644 index 4fedb95..0000000 --- a/examples/11-native-type-generic/output/rust/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "1.96" diff --git a/examples/11-native-type-generic/output/rust/src/gen/map.rs b/examples/11-native-type-generic/output/rust/src/gen/map.rs deleted file mode 100644 index 5d9c837..0000000 --- a/examples/11-native-type-generic/output/rust/src/gen/map.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Generated by hobgoblin. - -#[derive(Clone, Debug, Hash, PartialEq)] -pub struct X { - pub map: ::std::collections::BTreeMap::<::std::string::String, ::core::primitive::i32>, -} diff --git a/examples/11-native-type-generic/output/rust/src/lib.rs b/examples/11-native-type-generic/output/rust/src/lib.rs deleted file mode 100644 index b0adf47..0000000 --- a/examples/11-native-type-generic/output/rust/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod map; - -#[cfg(test)] -mod test { - use std::collections::BTreeMap; - use super::map::X; - - #[test] - fn can_use_generic_native_types() { - let x = X { map: BTreeMap::from([("a".to_string(), 1), ("b".to_string(), 2)]) }; - } -} diff --git a/examples/11-native-type-generic/output/rust/src/map.rs b/examples/11-native-type-generic/output/rust/src/map.rs deleted file mode 100644 index 3dd0a72..0000000 --- a/examples/11-native-type-generic/output/rust/src/map.rs +++ /dev/null @@ -1 +0,0 @@ -include!("gen/map.rs"); diff --git a/examples/11-native-type-generic/src/map.hob b/examples/11-native-type-generic/src/map.hob deleted file mode 100644 index 0118889..0000000 --- a/examples/11-native-type-generic/src/map.hob +++ /dev/null @@ -1,6 +0,0 @@ -native NativeMap[K, V] { -} - -struct X { - field map: NativeMap[String, Int32]; -} |
