### Start React Native Metro Development Server Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/example/README.md This snippet provides commands to start the Metro development server, which is the JavaScript build tool for React Native. Running Metro is the first essential step before building and running your application on a device or simulator. ```sh npm start ``` ```sh yarn start ``` -------------------------------- ### Install React Native iOS CocoaPods Dependencies Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/example/README.md This section provides commands for managing CocoaPods dependencies in a React Native iOS project. `bundle install` sets up the Ruby environment for CocoaPods, while `bundle exec pod install` installs or updates the native dependencies required by the iOS project. ```sh bundle install ``` ```sh bundle exec pod install ``` -------------------------------- ### Build and Run React Native Android App Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/example/README.md These commands are used to build and run the React Native application specifically for the Android platform. They will deploy the app to an attached Android device or an active emulator. ```sh npm run android ``` ```sh yarn android ``` -------------------------------- ### Build and Run React Native iOS App Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/example/README.md These commands are used to build and run the React Native application specifically for the iOS platform. They will deploy the app to an attached iOS device or an active simulator, assuming CocoaPods dependencies are already installed. ```sh npm run ios ``` ```sh yarn ios ``` -------------------------------- ### Build Android Project with Gradle Source: https://github.com/eatsteak/rusaint/blob/main/languages/kotlin/README.md This command initiates the build process for the Android project using `gradlew`. It assumes that the Rust toolchain and required Android targets have been previously installed and configured, as specified in the prerequisites, allowing the project to compile and link the Rust components. ```bash # Make sure rust toolchain and android targets are installed ./gradlew build ``` -------------------------------- ### Fetch and Print Course Grades in Rust Source: https://github.com/eatsteak/rusaint/blob/main/README.md This Rust example demonstrates how to log in to u-saint using a password, build a client for course grades, and retrieve semester grade information. It utilizes `futures::executor::block_on` for asynchronous operations and iterates through the retrieved grades, printing the details of each semester. ```rust use rusaint::application::course_grades::{CourseGrades, model::SemesterSummary}; use rusaint::session::USaintSession; use futures::executor::block_on; // 성적 정보를 출력하는 애플리케이션 fn main() { block_on(print_grades()); /* SemesterSummary { year: 2022, semester: "2 학기", attempted_credits: 17.5, earned_credits: 17.5, pf_earned_credits: 0.5, grade_points_average: 4.5, grade_points_sum: 100.0, arithmetic_mean: 100.0, semester_rank: (1, 99), general_rank: (1, 99), academic_probation: false, consult: false, flunked: false } * ... */ } async fn print_grades() -> Result<(), RusaintError> { // USaintSession::from_token(id: &str, token: &str) 을 이용하여 비밀번호 없이 SSO 토큰으로 로그인 할 수 있음 let session = USaintSession::from_password("20211561", "password").await?; let mut app = USaintClientBuilder::new().session(session).build_into::().await?; let grades: Vec = app.semesters(CourseType::Bachelor).await?; for grade in grades { println!("{:?}", grade); } Ok(()) } ``` -------------------------------- ### Install rusaint React Native Package via npm/yarn/pnpm Source: https://github.com/eatsteak/rusaint/blob/main/README.md This command installs the `@rusaint/react-native` package, which provides bindings for the rusaint library in React Native applications. Users can choose their preferred package manager: pnpm, yarn, or npm. ```bash pnpm add @rusaint/react-native # or yarn, npm ``` -------------------------------- ### Add Rust Android Targets for Cross-Compilation Source: https://github.com/eatsteak/rusaint/blob/main/languages/kotlin/README.md This command snippet adds the necessary `rustup` targets for various Android architectures (ARMv7, x86, ARM64, x86_64). These targets are crucial for cross-compiling Rust code to run on different Android devices, enabling the Rust library to be integrated into the Android application. ```bash rustup target add armv7-linux-androideabi # for arm rustup target add i686-linux-android # for x86 rustup target add aarch64-linux-android # for arm64 rustup target add x86_64-linux-android # for x86_64 ``` -------------------------------- ### Initialize CMake Project and Resolve Bindgen Path Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/android/CMakeLists.txt This section sets up the basic CMake project, specifies the required CMake version and C++ standard. It then dynamically resolves the installation path of the `uniffi-bindgen-react-native` package using a Node.js command, which is critical for locating generated C++ headers and libraries required for the build. ```CMake cmake_minimum_required(VERSION 3.9.0) project(RusaintReactNative) set (CMAKE_VERBOSE_MAKEFILE ON) set (CMAKE_CXX_STANDARD 17) # Resolve the path to the uniffi-bindgen-react-native package execute_process( COMMAND node -p "require.resolve('uniffi-bindgen-react-native/package.json')" OUTPUT_VARIABLE UNIFFI_BINDGEN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "/package\\.json$" "" UNIFFI_BINDGEN_PATH ${UNIFFI_BINDGEN_PATH} ) ``` -------------------------------- ### Install rusaint Crate with Cargo Source: https://github.com/eatsteak/rusaint/blob/main/README.md This command adds the `rusaint` crate as a dependency to your Rust project using Cargo, Rust's official package manager. It's the standard way to include external libraries in Rust applications. ```bash cargo add rusaint ``` -------------------------------- ### Define Include Paths and Create React Native Module Library Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/android/CMakeLists.txt This part of the CMake configuration specifies all necessary include directories for the C++ source files, including local C++ code, generated FFI code, and headers provided by the `uniffi-bindgen-react-native` package. It then defines the `rusaint-react-native` shared library, listing all its constituent C++ source files. ```CMake # Specifies a path to native header files. include_directories( ../cpp ../cpp/generated ${UNIFFI_BINDGEN_PATH}/cpp/includes ) add_library(rusaint-react-native SHARED ../cpp/rusaint-react-native.cpp ../cpp/generated/rusaint.cpp ../cpp/generated/rusaint_ffi.cpp cpp-adapter.cpp ) ``` -------------------------------- ### Import and Link Rust FFI Static Library Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/android/CMakeLists.txt This part of the configuration handles the integration of the pre-compiled Rust FFI static library (`librusaint_ffi.a`). It constructs the correct path to this library based on the Android ABI, normalizes it, and then imports it into the CMake project as a static library. This imported library (`my_rust_lib`) can then be linked with the C++ React Native module. ```CMake cmake_path( SET MY_RUST_LIB ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/librusaint_ffi.a NORMALIZE ) add_library(my_rust_lib STATIC IMPORTED) set_target_properties(my_rust_lib PROPERTIES IMPORTED_LOCATION ${MY_RUST_LIB}) ``` -------------------------------- ### Add rusaint Dependency to Android Project (Kotlin Gradle) Source: https://github.com/eatsteak/rusaint/blob/main/README.md This Kotlin Gradle snippet illustrates how to integrate the `rusaint` library into an Android project. It involves configuring the `mavenCentral()` repository and then declaring the `dev.eatsteak:rusaint` dependency within the `dependencies` block of your `build.gradle.kts` file. ```kotlin repositories { mavenCentral() // ... any other repositories } dependencies { implementation("dev.eatsteak:rusaint:0.10.0") } ``` -------------------------------- ### SAP UI Component Reference List Source: https://github.com/eatsteak/rusaint/blob/main/elements.md A detailed list of user interface components, including their short codes (abbreviations) and full names. The indentation indicates hierarchical relationships, where sub-items are components nested within or related to their parent component. This serves as a reference for developers working with the specified UI framework, outlining available elements and their structure. ```APIDOC - [ ] AL: AbapList - [ ] ALT: AbapListText - [ ] ALI: AbapListImage - [ ] ALC: AbapListCheckBox - [ ] ALCO: AbapListContainer - [ ] ALTA: AbapListTabActor - [ ] ACR: Accordion - [ ] ACRI: AccordionItem - [ ] ACF: AcpAdapter - [ ] AX: ActiveX - [ ] AP: Applet - [ ] AS: AriaStatic (!) - [ ] BCR: BarcodeReader - [ ] BIAF: BiApplicationFrame - [ ] BRC: BreadCrumb - [ ] BRCI: BreadCrumbItem - [x] B: Button - [X] BR: ButtonRow - [ ] CGR: CssGrid - [ ] CGRI: CssGridItem - [ ] CAL_DAY: CalendarDayView - [ ] CAL_ENTRY: CalendarEntry - [ ] CAL_MONTH: CalendarMonthView - [ ] CAL_YEAR: CalendarYearView - [ ] CAL_RH: CalendarRowHeader - [X] CP: Caption - [ ] CARS: Carousel(Single) - [ ] CARM: Carousel(Multiple) - [ ] CHART: Chart - [ ] CG: CheckBoxGroup - [ ] C: Checkbox(standards,ie6) - [x] CI: ClientInspector - [ ] COI: ColorItem - [ ] CL: ColumnLayout - [ ] CLS: ColumnLayoutSection - [ ] CLC: ColumnLayoutCell(Fragment) - [X] CB: ComboBox - [ ] CBS: ComboBoxString - [X] CO: Container (!) - [ ] CTAR: ContentArea - [ ] CXP: ContextualPanel - [ ] DT~: DropTarget~ - [ ] DTC: DropTargetContainer(DTContainer) - [ ] DTE: DropTargetElement(DTElement) - [ ] DG: DataGrid - [ ] DGSC: DataGridSegmentCell - [ ] DGS: DataGridSegment - [ ] DT: DataTip - [ ] DN: DateNavigator - [ ] DSI: DragSourceInfo - [ ] DTI: DropTargetInfo - [ ] DRT: DropTarget - [ ] FU: FileUploadInput - [ ] FLC: Flash - [X] FL: FlowLayout (!) - [ ] FLL: FluidLayout - [ ] FLCL: FluidLayoutCell - [ ] FLCO: FluidLayoutContainer - [x] FOR: Form - [ ] FTV: FormattedTextView - [ ] FRA: FreeContextualArea - [ ] GM: GeoMap - [X] GL: GridLayout (!) - [X] GLC: GridLayoutCell (!) - [ ] G: Group (!) - [ ] HTV: HtmlTextView - [ ] HAR: HeaderArea - [ ] HV: HierarchicalView - [ ] HCNP: HorizontalContextualPanel(standards,ie6) - [ ] HCNPI: HorizontalContextualPanelItem(standards,ie6) - [ ] HCNPMI: HorizontalContextualPanelMenuItems(standards,ie6) - [ ] HD: HorizontalDivider - [ ] HKC: Hotkeys (!) - [ ] HK: Hotkey - [ ] HI: HTMLIsland - [ ] IHUB: IHub (!) - [ ] IHUBEVENTING: IHubEventing - [ ] IHUBFRAMEPROTECT: IHubFrameProtect - [ ] IHUBLEGACYWDJ: IHubLegacyWDJ - [ ] IHUBMESSAGING: IHubMessaging - [ ] IHUBNAVIGATION: IHubNavigation - [ ] IHUBPOSTMESSAGE: IHubPostMessage - [ ] IHUBWEBSOCKET: IHubWebSocket (!) - [ ] IHUBWORKPROTECT: IHubWorkProtect (!) - [ ] IF: Iframe - [ ] IMGM: ImageMap - [ ] IMGMA: ImageMapArea - [X] IMG: Image - [X] I: InputField (!) - [ ] II: InputField(with DisplayAsText) - [ ] IT: InputFieldText - [ ] IFA: InteractiveFormAbap - [ ] IFO: InteractiveForm - [ ] INV: Invisible - [ ] ILB~: ItemListBox - [ ] ILBS: ItemListBoxSingle - [ ] ILBM: ItemListBoxMultiple - [ ] ILBI: ItemListBoxItem - [ ] CBSLB: ComboBoxSearchListBox - [ ] CBILB: ComboBoxItemListBox - [ ] ILBAI: ItemListBoxActionItem - [X] LIB_~: ListBox - [X] LIB_P: ListBox(in Popup) - [X] LIB_PJ: ListBox(popup, TableData) - [X] LIB_PS: ListBox(popup, searchable) - [X] LIB_PJS: ListBox(popup, TableData, searchable) - [X] LIB_M: ListBox(MultipleSelection) - [X] LIB_S: ListBox(SingleSelection) - [X] LIB_I: ListBoxItem - [X] LIB_AI: ListBoxActionItem - [ ] IL: ItemList - [ ] ILI: ItemListItem - [X] L: Label (!) - [ ] LB: LargeButton - [ ] LEG: Legend - [ ] LNC: LinkChoice - [x] LN: LinkContent - [ ] LA: LoadingAnimation (!) - [x] LP: LoadingPlaceholder - [ ] ML: MatrixLayoutBase (!) - [ ] MLC: MatrixLayoutCell - [ ] MG: MeltingGroup - [ ] MNB: MenuBar - [ ] MNBI: MenuBarItem - [ ] MA: MessageArea - [ ] MSG: Message - [ ] MB: MessageBar - [ ] MSGT: MessagingTrigger - [ ] MODELCONTROL: ModelControl - [ ] NL: NavigationList - [ ] NLG: NavigationListGroup - [ ] NLI: NavigationListItem - [ ] OC: ObjectContainer - [ ] OH: ObjectHeader - [ ] ONI: ObjectNavigationItem - [ ] ON: ObjectNavigation - [ ] PDF: PDF - [ ] PMSDIRTY: PMServiceDirty - [ ] PMSGENRESP: PMServiceGenericResponder - [ ] PMSTHEMECHANGE: PMServiceThemeChange - [ ] PMSTIMEOUT: PMServiceTimeout - [ ] PMSUSHELLSESSION: PMServiceUShellSessionHandler - [ ] PMSWEBASSIST: PMServiceWebAssistant - [ ] PHM: PageHeaderTitle - [ ] PLP: PageLayoutPanel - [ ] PL: PageLayout - [ ] PAGE: Page (!) - [ ] PGR: Pager - [ ] PG: Paginator - [ ] P: Panel - [ ] PST: PanelStack - [ ] PCI: PatternContainerIconButton - [ ] PCSEQ: PatternContainerSequence - [ ] PCSEQITEM: PatternContainerSequenceItem - [ ] PCTAB: PatternContainerTab - [ ] PCTABITM: PatternContainerTabItem - [ ] PCTIT: PatternContainerTitle - [ ] PERSONASFACADE: PersonasFacade - [ ] PHI: PhaseIndicator - [ ] PHII: PhaseIndicatorItem(PhaseIndicatorPhase) - [ ] PI: PopIn - [ ] POPOVERCONTAINER: PopoverContainer - [ ] POMN: PopupMenu - [ ] POMNI: PopupMenuItem - [ ] POTRG: PopupTrigger - [ ] PW: PopupWindow - [ ] PMSS: PostMessageServices ``` -------------------------------- ### Link React Native, JSI, and Other Core Dependencies Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/android/CMakeLists.txt This final section is responsible for linking the `rusaint-react-native` module with various essential React Native and Android dependencies. It dynamically links `ReactAndroid` components based on the React Native version (handling pre/post 0.76 changes), `fbjni`, `jsi`, the Android `log` library, and the previously imported Rust static library. This ensures the native module can interact correctly with the React Native runtime and other native components. ```CMake # Add ReactAndroid libraries, being careful to account for different versions. find_package(ReactAndroid REQUIRED CONFIG) find_library(LOGCAT log) # REACTNATIVE_MERGED_SO seems to be only be set in a build.gradle.kt file, # which we don't use. Thus falling back to version number sniffing. if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) set(REACTNATIVE_MERGED_SO true) endif() # https://github.com/react-native-community/discussions-and-proposals/discussions/816 # This if-then-else can be removed once this library does not support version below 0.76 if (REACTNATIVE_MERGED_SO) target_link_libraries(rusaint-react-native ReactAndroid::reactnative) else() target_link_libraries(rusaint-react-native ReactAndroid::turbomodulejsijni ReactAndroid::react_nativemodule_core ) endif() find_package(fbjni REQUIRED CONFIG) target_link_libraries( rusaint-react-native fbjni::fbjni ReactAndroid::jsi ${LOGCAT} my_rust_lib ) ``` -------------------------------- ### Configure C++ Compiler Flags for React Native Module Source: https://github.com/eatsteak/rusaint/blob/main/languages/react-native/android/CMakeLists.txt This section sets various C++ compiler flags (`CMAKE_CXX_FLAGS`) for the `rusaint-react-native` library. These flags include optimization (`-O2`), enabling exceptions (`-fexceptions`) and RTTI (`-frtti`), enhancing security with stack protection (`-fstack-protector-all`), and enforcing strict code quality with all warnings (`-Wall`) and treating warnings as errors (`-Werror`). ```CMake # Set C++ compiler flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.