Swift-CC


Source link: https://github.com/swift-cc/tools

Tools

## Swift-CC ### Introduction

swift-cc is a python script that simplifies the compiling of Swift and Objective-C(++) code into object files.

Once installed, you can easily compile any number of Swift and Objective-C(++) files into object files that are targeted for armv7.

###Overview

swift-cc is a two stage wrapper for clang and the swift compiler that uses the Android NDK tools to produce android compatible .o files.

The first stage uses clang or swift to compile source code and emit LLVM-IR code which is passed to the Android second stage tools which compile the IR into .o files.

All of this is completely handled by the tool, and so the tool is super easy to use.

script-cc.py file.mm file2.swift 

This will produce file.o and file2.o which can be linked using the Android NDK library archiver or linker.

For other info, use the following to get command line help.

script-cc.py -h 

Installation

In order to be able to use the tool from anywhere, i.e. in Android.mk or other makefiles, it needs to be added to the environment path variable.

Open up your .bash_profile or whatever file you use for setting up your environment, and add the following line before the path export.

PATH=$PATH:<your path to swift-cc.py> 

Remember to re-parse the profile using source .bash_profile or whatever your profile name is.

Once installed, this script will be available from anywhere and can be used as a drop in compiler for compiling Swift and Objective-C(++) into object files for Android.

Configuration

There is an example configuration file config_example.txt

There are four variables you need to setup in order for the tool to work. The config file must be in the same directory as the tool, and must be named config.txt. It is a simple key value pair file that has variables that tell the tool where Xcode, Android SDK/NDK are etc.

The variable are at the top of the file, and are named as follows.

MODULE_NAME = <your module name>  XCODE = <path to xcode.app>
 ANDROID_SDK = <path to android sdk>  ANDROID_NDK = <path to android ndk> 

Once these variables have been set, the tool should work out of the box. The rest of the variables in the config file are derived from these four config variables.

Resources

Complete abstraction from the Spannable API. Forget about all the boiler plate code and all the Object what nonsense that you have to deal with when working with Spannable.

  • Eliminate setSpan calls by using all the provided methods trough the StyleEZ interface.
  • Chain multiple spans with a fluent style
  • By using both the ContentEZ and StyleEZ interface it removes unnecessary methods from the autocomplete form, and thus it removes clutter.
  • Allows different ways of adding content (String, String Resource and Formatted String)
  • By default it does INCLUSIVE_INCLUSIVE to all the spans
  • After calling any of the inclusive/exclusive methods, all the next methods will be using that flag until apply is called or another flag is used
  • You can create your own locator by extending the Locator interface

FadingTextView is a TextView that changes its content automatically every few seconds.

An example android application to set dynamic span size on GridLayoutManager, RecyclerView.

Android Library for custom views to control brightness , volume and seek through swipable gestures . These views could easily replace the conventional volume / brightness / seek controls that we have in music player ,video player or gallery apps.

Changes the color of individual pixels in a Bitmap.

Simple library to help with keyboard operations.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes