From 32a30cc793eec14edad1d7d0826a1d65214d9b7b Mon Sep 17 00:00:00 2001 From: Firoz Ahmed Date: Thu, 8 Aug 2019 06:51:15 +0530 Subject: [PATCH] first commit --- .gitattributes | 1 + .gitignore | 42 +++ .npmignore | 0 README.md | 43 +++ android/README.md | 14 + android/build.gradle | 125 ++++++++ android/src/main/AndroidManifest.xml | 4 + .../reactlibrary/CompassHeadingModule.java | 27 ++ .../reactlibrary/CompassHeadingPackage.java | 23 ++ index.js | 5 + ios/CompassHeading.h | 5 + ios/CompassHeading.m | 14 + ios/CompassHeading.xcodeproj/project.pbxproj | 271 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + package.json | 33 +++ react-native-compass-heading.podspec | 26 ++ 16 files changed, 640 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 README.md create mode 100644 android/README.md create mode 100644 android/build.gradle create mode 100644 android/src/main/AndroidManifest.xml create mode 100644 android/src/main/java/com/reactlibrary/CompassHeadingModule.java create mode 100644 android/src/main/java/com/reactlibrary/CompassHeadingPackage.java create mode 100644 index.js create mode 100644 ios/CompassHeading.h create mode 100644 ios/CompassHeading.m create mode 100644 ios/CompassHeading.xcodeproj/project.pbxproj create mode 100644 ios/CompassHeading.xcworkspace/contents.xcworkspacedata create mode 100644 package.json create mode 100644 react-native-compass-heading.podspec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d42ff18 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.pbxproj -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5464d9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# OSX +# +.DS_Store + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml + +# BUCK +buck-out/ +\.buckd/ +*.keystore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..c82a643 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# react-native-compass-heading + +## Getting started + +`$ npm install react-native-compass-heading --save` + +### Mostly automatic installation + +`$ react-native link react-native-compass-heading` + +### Manual installation + + +#### iOS + +1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` +2. Go to `node_modules` ➜ `react-native-compass-heading` and add `CompassHeading.xcodeproj` +3. In XCode, in the project navigator, select your project. Add `libCompassHeading.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` +4. Run your project (`Cmd+R`)< + +#### Android + +1. Open up `android/app/src/main/java/[...]/MainApplication.java` + - Add `import com.reactlibrary.CompassHeadingPackage;` to the imports at the top of the file + - Add `new CompassHeadingPackage()` to the list returned by the `getPackages()` method +2. Append the following lines to `android/settings.gradle`: + ``` + include ':react-native-compass-heading' + project(':react-native-compass-heading').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-compass-heading/android') + ``` +3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: + ``` + compile project(':react-native-compass-heading') + ``` + + +## Usage +```javascript +import CompassHeading from 'react-native-compass-heading'; + +// TODO: What to do with the module? +CompassHeading; +``` diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..c2ccc01 --- /dev/null +++ b/android/README.md @@ -0,0 +1,14 @@ +README +====== + +If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: + +1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed +2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK +``` +ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle +sdk.dir=/Users/{username}/Library/Android/sdk +``` +3. Delete the `maven` folder +4. Run `sudo ./gradlew installArchives` +5. Verify that latest set of generated files is in the maven folder with the correct version number diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..94e9880 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,125 @@ +buildscript { + ext.safeExtGet = {prop, fallback -> + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback + } + repositories { + google() + jcenter() + } + + dependencies { + // Matches recent template from React Native (0.60) + // https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L16 + classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '3.4.1')}") + } +} + +apply plugin: 'com.android.library' +apply plugin: 'maven' + +// Matches values in recent template from React Native (0.59) +// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9 +def DEFAULT_COMPILE_SDK_VERSION = 28 +def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3" +def DEFAULT_MIN_SDK_VERSION = 16 +def DEFAULT_TARGET_SDK_VERSION = 28 + +android { + compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) + buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) + + defaultConfig { + minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) + targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + versionCode 1 + versionName "1.0" + } + lintOptions { + abortOnError false + } +} + +repositories { + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + // Matches recent template from React Native (0.59) + // https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L30 + url "$projectDir/../node_modules/react-native/android" + } + mavenCentral() +} + +dependencies { + implementation "com.facebook.react:react-native:${safeExtGet('reactnativeVersion', '+')}" +} + +def configureReactNativePom(def pom) { + def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) + + pom.project { + name packageJson.title + artifactId packageJson.name + version = packageJson.version + group = "com.reactlibrary" + description packageJson.description + url packageJson.repository.baseUrl + + licenses { + license { + name packageJson.license + url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename + distribution 'repo' + } + } + + developers { + developer { + id packageJson.author.username + name packageJson.author.name + } + } + } +} + +afterEvaluate { project -> + + task androidJavadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += files(android.bootClasspath) + classpath += files(project.getConfigurations().getByName('compile').asList()) + include '**/*.java' + } + + task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { + classifier = 'javadoc' + from androidJavadoc.destinationDir + } + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs + include '**/*.java' + } + + android.libraryVariants.all { variant -> + def name = variant.name.capitalize() + task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { + from variant.javaCompile.destinationDir + } + } + + artifacts { + archives androidSourcesJar + archives androidJavadocJar + } + + task installArchives(type: Upload) { + configuration = configurations.archives + repositories.mavenDeployer { + // Deploy to react-native-event-bridge/maven, ready to publish to npm + repository url: "file://${projectDir}/../android/maven" + + configureReactNativePom pom + } + } +} diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..20c90c4 --- /dev/null +++ b/android/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + diff --git a/android/src/main/java/com/reactlibrary/CompassHeadingModule.java b/android/src/main/java/com/reactlibrary/CompassHeadingModule.java new file mode 100644 index 0000000..6558a5c --- /dev/null +++ b/android/src/main/java/com/reactlibrary/CompassHeadingModule.java @@ -0,0 +1,27 @@ +package com.reactlibrary; + +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReactContextBaseJavaModule; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.Callback; + +public class CompassHeadingModule extends ReactContextBaseJavaModule { + + private final ReactApplicationContext reactContext; + + public CompassHeadingModule(ReactApplicationContext reactContext) { + super(reactContext); + this.reactContext = reactContext; + } + + @Override + public String getName() { + return "CompassHeading"; + } + + @ReactMethod + public void sampleMethod(String stringArgument, int numberArgument, Callback callback) { + // TODO: Implement some actually useful functionality + callback.invoke("Received numberArgument: " + numberArgument + " stringArgument: " + stringArgument); + } +} diff --git a/android/src/main/java/com/reactlibrary/CompassHeadingPackage.java b/android/src/main/java/com/reactlibrary/CompassHeadingPackage.java new file mode 100644 index 0000000..a792fdd --- /dev/null +++ b/android/src/main/java/com/reactlibrary/CompassHeadingPackage.java @@ -0,0 +1,23 @@ +package com.reactlibrary; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.ViewManager; +import com.facebook.react.bridge.JavaScriptModule; + +public class CompassHeadingPackage implements ReactPackage { + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + return Arrays.asList(new CompassHeadingModule(reactContext)); + } + + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/index.js b/index.js new file mode 100644 index 0000000..00780b5 --- /dev/null +++ b/index.js @@ -0,0 +1,5 @@ +import { NativeModules } from 'react-native'; + +const { CompassHeading } = NativeModules; + +export default CompassHeading; diff --git a/ios/CompassHeading.h b/ios/CompassHeading.h new file mode 100644 index 0000000..f39015b --- /dev/null +++ b/ios/CompassHeading.h @@ -0,0 +1,5 @@ +#import + +@interface CompassHeading : NSObject + +@end diff --git a/ios/CompassHeading.m b/ios/CompassHeading.m new file mode 100644 index 0000000..e42d450 --- /dev/null +++ b/ios/CompassHeading.m @@ -0,0 +1,14 @@ +#import "CompassHeading.h" + + +@implementation CompassHeading + +RCT_EXPORT_MODULE() + +RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback) +{ + // TODO: Implement some actually useful functionality + callback(@[[NSString stringWithFormat: @"numberArgument: %@ stringArgument: %@", numberArgument, stringArgument]]); +} + +@end diff --git a/ios/CompassHeading.xcodeproj/project.pbxproj b/ios/CompassHeading.xcodeproj/project.pbxproj new file mode 100644 index 0000000..650d478 --- /dev/null +++ b/ios/CompassHeading.xcodeproj/project.pbxproj @@ -0,0 +1,271 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + B3E7B58A1CC2AC0600A0062D /* CompassHeading.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* CompassHeading.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 58B511D91A9E6C8500147676 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 134814201AA4EA6300B7C361 /* libCompassHeading.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCompassHeading.a; sourceTree = BUILT_PRODUCTS_DIR; }; + B3E7B5881CC2AC0600A0062D /* CompassHeading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompassHeading.h; sourceTree = ""; }; + B3E7B5891CC2AC0600A0062D /* CompassHeading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CompassHeading.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 58B511D81A9E6C8500147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 134814211AA4EA7D00B7C361 /* Products */ = { + isa = PBXGroup; + children = ( + 134814201AA4EA6300B7C361 /* libCompassHeading.a */, + ); + name = Products; + sourceTree = ""; + }; + 58B511D21A9E6C8500147676 = { + isa = PBXGroup; + children = ( + B3E7B5881CC2AC0600A0062D /* CompassHeading.h */, + B3E7B5891CC2AC0600A0062D /* CompassHeading.m */, + 134814211AA4EA7D00B7C361 /* Products */, + ); + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 58B511DA1A9E6C8500147676 /* CompassHeading */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "CompassHeading" */; + buildPhases = ( + 58B511D71A9E6C8500147676 /* Sources */, + 58B511D81A9E6C8500147676 /* Frameworks */, + 58B511D91A9E6C8500147676 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CompassHeading; + productName = RCTDataManager; + productReference = 134814201AA4EA6300B7C361 /* libCompassHeading.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 58B511D31A9E6C8500147676 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 58B511DA1A9E6C8500147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "CompassHeading" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 58B511D21A9E6C8500147676; + productRefGroup = 58B511D21A9E6C8500147676; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 58B511DA1A9E6C8500147676 /* CompassHeading */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 58B511D71A9E6C8500147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B3E7B58A1CC2AC0600A0062D /* CompassHeading.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 58B511ED1A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 58B511EE1A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 58B511F01A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../../React/**", + "$(SRCROOT)/../../react-native/React/**", + ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = CompassHeading; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 58B511F11A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../../React/**", + "$(SRCROOT)/../../react-native/React/**", + ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = CompassHeading; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "CompassHeading" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511ED1A9E6C8500147676 /* Debug */, + 58B511EE1A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "CompassHeading" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511F01A9E6C8500147676 /* Debug */, + 58B511F11A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 58B511D31A9E6C8500147676 /* Project object */; +} diff --git a/ios/CompassHeading.xcworkspace/contents.xcworkspacedata b/ios/CompassHeading.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..db6cc99 --- /dev/null +++ b/ios/CompassHeading.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..90e08e8 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "react-native-compass-heading", + "title": "React Native Compass Heading", + "version": "1.0.0", + "description": "TODO", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/github_account/react-native-compass-heading.git", + "baseUrl": "https://github.com/github_account/react-native-compass-heading" + }, + "keywords": [ + "react-native" + ], + "author": { + "name": "Your Name", + "email": "yourname@email.com" + }, + "license": "MIT", + "licenseFilename": "LICENSE", + "readmeFilename": "README.md", + "peerDependencies": { + "react": "^16.5.0", + "react-native": ">=0.57.0-rc.0 <1.0.x" + }, + "devDependencies": { + "react": "^16.5.0", + "react-native": "^0.59.4" + } +} diff --git a/react-native-compass-heading.podspec b/react-native-compass-heading.podspec new file mode 100644 index 0000000..b70e5e6 --- /dev/null +++ b/react-native-compass-heading.podspec @@ -0,0 +1,26 @@ +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) + +Pod::Spec.new do |s| + s.name = "react-native-compass-heading" + s.version = package["version"] + s.summary = package["description"] + s.description = <<-DESC + react-native-compass-heading + DESC + s.homepage = "https://github.com/github_account/react-native-compass-heading" + s.license = "MIT" + # s.license = { :type => "MIT", :file => "FILE_LICENSE" } + s.authors = { "Your Name" => "yourname@email.com" } + s.platform = :ios, "7.0" + s.source = { :git => "https://github.com/github_account/react-native-compass-heading.git", :tag => "#{s.version}" } + + s.source_files = "ios/**/*.{h,m,swift}" + s.requires_arc = true + + s.dependency "React" + + # s.dependency "..." +end +