Skip to content
Open
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
22 changes: 12 additions & 10 deletions example/ios/NitroExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NitroExample/Pods-NitroExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NitroExample/Pods-NitroExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroExample/Pods-NitroExample-frameworks.sh\"\n";
Expand Down Expand Up @@ -294,10 +298,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NitroExample/Pods-NitroExample-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NitroExample/Pods-NitroExample-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroExample/Pods-NitroExample-resources.sh\"\n";
Expand Down Expand Up @@ -389,7 +397,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = CJW62Q77E7;
DEVELOPMENT_TEAM = SCHCH5LRT6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = NitroExample/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Nitro Example";
Expand Down Expand Up @@ -424,7 +432,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = CJW62Q77E7;
DEVELOPMENT_TEAM = SCHCH5LRT6;
INFOPLIST_FILE = NitroExample/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Nitro Example";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
Expand Down Expand Up @@ -524,10 +532,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -603,10 +608,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
FBLazyVector: 7c1d69992204c5ec452eeefa4a24b0ff311709c8
hermes-engine: 16e781d7fca74c8bb3ca59b99527d9633ee9ee36
hermes-engine: 8b78a0b773116bfcfd324d0ad50bcf419171e6ae
NitroModules: 61a246a8e9ef0c478d6d97f0d95c6f5dcdfcca71
NitroTest: 71bbd6e350ca62daeb2f4156c1fca24c5bb96439
NitroTestExternal: 74e7a5db8a645a3800a17fde4030e3c1485ad305
Expand All @@ -2229,7 +2229,7 @@ SPEC CHECKSUMS:
React: f6f8fc5c01e77349cdfaf49102bcb928ac31d8ed
React-callinvoker: 3e62a849bda1522c6422309c02f5dc3210bc5359
React-Core: 0b765bc7c2b83dff178c2b03ed8a0390df26f18c
React-Core-prebuilt: 88810feb58457484bff17e9e91a15453407d745a
React-Core-prebuilt: cce101ef82279b4b60e96236d53d0db8e4a30c8a
React-CoreModules: 55b932564ba696301cb683a86385be6a6f137e57
React-cxxreact: 5bfb95256fde56cc0f9ce425f38cfaa085e71ad2
React-debug: f9dda2791d3ebe2078bc6102641edab77917efb7
Expand Down Expand Up @@ -2292,10 +2292,10 @@ SPEC CHECKSUMS:
ReactAppDependencyProvider: 23e2bca1661f8781e55fcc05a151fc1df97bc1fb
ReactCodegen: c049d7e966ed24be56d8e21cb1b8880316975e76
ReactCommon: 89ccc6cb100ca5a0303b46483037ef8f3e06e2e0
ReactNativeDependencies: 1a7e3c3ffa57533d8118dd9bc01790ffa9e02a3b
ReactNativeDependencies: 251232958c0c6ce4b994497a2cea85b9cdb0e31c
RNScreens: dd61bc3a3e6f6901ad833efa411917d44827cf51
Yoga: 21f482cbc18b56cdc477cd3a0c5b8c2c83ac27ce

PODFILE CHECKSUM: b10c50487e0abdde430dd55fff9d2c50a2e3a09c

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import NitroModules
import NitroTestExternal

class HybridTestObjectSwift: HybridTestObjectSwiftKotlinSpec {
func updateTravelEstimates(templateId: String, steps: [TripPoint]) throws -> Void {
}

func updateManeuvers(templateId: String, maneuvers: [NitroRoutingManeuver]) throws -> Void {
}

var optionalArray: [String]? = []

var someVariant: Variant_String_Double = .second(55)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ target_sources(
../nitrogen/generated/android/c++/JVariant_HybridBaseSpec_OptionalWrapper.cpp
../nitrogen/generated/android/c++/JCoreTypesVariant.cpp
../nitrogen/generated/android/c++/JStringOrExternal.cpp
../nitrogen/generated/android/c++/JNitroImage.cpp
../nitrogen/generated/android/c++/JVariant_AssetImage_GlyphImage.cpp
../nitrogen/generated/android/c++/JVariant_PreferredImageLane_ImageLane.cpp
../nitrogen/generated/android/c++/JVariant_Boolean_DoubleArray_Array_String__String_Double.cpp
../nitrogen/generated/android/c++/JHybridTestViewSpec.cpp
../nitrogen/generated/android/c++/views/JHybridTestViewStateUpdater.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
///
/// JAssetImage.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#include <fbjni/fbjni.h>
#include "AssetImage.hpp"

#include "JNitroColor.hpp"
#include "NitroColor.hpp"
#include <optional>
#include <string>

namespace margelo::nitro::test {

using namespace facebook;

/**
* The C++ JNI bridge between the C++ struct "AssetImage" and the the Kotlin data class "AssetImage".
*/
struct JAssetImage final: public jni::JavaClass<JAssetImage> {
public:
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/test/AssetImage;";

public:
/**
* Convert this Java/Kotlin-based struct to the C++ struct AssetImage by copying all values to C++.
*/
[[maybe_unused]]
[[nodiscard]]
AssetImage toCpp() const {
static const auto clazz = javaClassStatic();
static const auto fieldColor = clazz->getField<JNitroColor>("color");
jni::local_ref<JNitroColor> color = this->getFieldValue(fieldColor);
static const auto fieldPackager_asset = clazz->getField<jboolean>("packager_asset");
jboolean packager_asset = this->getFieldValue(fieldPackager_asset);
static const auto fieldHeight = clazz->getField<double>("height");
double height = this->getFieldValue(fieldHeight);
static const auto fieldWidth = clazz->getField<double>("width");
double width = this->getFieldValue(fieldWidth);
static const auto fieldScale = clazz->getField<double>("scale");
double scale = this->getFieldValue(fieldScale);
static const auto fieldUri = clazz->getField<jni::JString>("uri");
jni::local_ref<jni::JString> uri = this->getFieldValue(fieldUri);
return AssetImage(
color != nullptr ? std::make_optional(color->toCpp()) : std::nullopt,
static_cast<bool>(packager_asset),
height,
width,
scale,
uri->toStdString()
);
}

public:
/**
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
*/
[[maybe_unused]]
static jni::local_ref<JAssetImage::javaobject> fromCpp(const AssetImage& value) {
using JSignature = JAssetImage(jni::alias_ref<JNitroColor>, jboolean, double, double, double, jni::alias_ref<jni::JString>);
static const auto clazz = javaClassStatic();
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
return create(
clazz,
value.color.has_value() ? JNitroColor::fromCpp(value.color.value()) : nullptr,
value.packager_asset,
value.height,
value.width,
value.scale,
jni::make_jstring(value.uri)
);
}
};

} // namespace margelo::nitro::test
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
///
/// JAutoText.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#include <fbjni/fbjni.h>
#include "AutoText.hpp"

#include "Distance.hpp"
#include "DistanceUnits.hpp"
#include "JDistance.hpp"
#include "JDistanceUnits.hpp"
#include <optional>
#include <string>

namespace margelo::nitro::test {

using namespace facebook;

/**
* The C++ JNI bridge between the C++ struct "AutoText" and the the Kotlin data class "AutoText".
*/
struct JAutoText final: public jni::JavaClass<JAutoText> {
public:
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/test/AutoText;";

public:
/**
* Convert this Java/Kotlin-based struct to the C++ struct AutoText by copying all values to C++.
*/
[[maybe_unused]]
[[nodiscard]]
AutoText toCpp() const {
static const auto clazz = javaClassStatic();
static const auto fieldText = clazz->getField<jni::JString>("text");
jni::local_ref<jni::JString> text = this->getFieldValue(fieldText);
static const auto fieldDistance = clazz->getField<JDistance>("distance");
jni::local_ref<JDistance> distance = this->getFieldValue(fieldDistance);
static const auto fieldDuration = clazz->getField<jni::JDouble>("duration");
jni::local_ref<jni::JDouble> duration = this->getFieldValue(fieldDuration);
return AutoText(
text->toStdString(),
distance != nullptr ? std::make_optional(distance->toCpp()) : std::nullopt,
duration != nullptr ? std::make_optional(duration->value()) : std::nullopt
);
}

public:
/**
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
*/
[[maybe_unused]]
static jni::local_ref<JAutoText::javaobject> fromCpp(const AutoText& value) {
using JSignature = JAutoText(jni::alias_ref<jni::JString>, jni::alias_ref<JDistance>, jni::alias_ref<jni::JDouble>);
static const auto clazz = javaClassStatic();
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
return create(
clazz,
jni::make_jstring(value.text),
value.distance.has_value() ? JDistance::fromCpp(value.distance.value()) : nullptr,
value.duration.has_value() ? jni::JDouble::valueOf(value.duration.value()) : nullptr
);
}
};

} // namespace margelo::nitro::test
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
///
/// JDistance.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#include <fbjni/fbjni.h>
#include "Distance.hpp"

#include "DistanceUnits.hpp"
#include "JDistanceUnits.hpp"

namespace margelo::nitro::test {

using namespace facebook;

/**
* The C++ JNI bridge between the C++ struct "Distance" and the the Kotlin data class "Distance".
*/
struct JDistance final: public jni::JavaClass<JDistance> {
public:
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/test/Distance;";

public:
/**
* Convert this Java/Kotlin-based struct to the C++ struct Distance by copying all values to C++.
*/
[[maybe_unused]]
[[nodiscard]]
Distance toCpp() const {
static const auto clazz = javaClassStatic();
static const auto fieldValue = clazz->getField<double>("value");
double value = this->getFieldValue(fieldValue);
static const auto fieldUnit = clazz->getField<JDistanceUnits>("unit");
jni::local_ref<JDistanceUnits> unit = this->getFieldValue(fieldUnit);
return Distance(
value,
unit->toCpp()
);
}

public:
/**
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
*/
[[maybe_unused]]
static jni::local_ref<JDistance::javaobject> fromCpp(const Distance& value) {
using JSignature = JDistance(double, jni::alias_ref<JDistanceUnits>);
static const auto clazz = javaClassStatic();
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
return create(
clazz,
value.value,
JDistanceUnits::fromCpp(value.unit)
);
}
};

} // namespace margelo::nitro::test
Loading
Loading