Skip to content

Commit

Permalink
Depend on android-textile (#75)
Browse files Browse the repository at this point in the history
* Depend on android-textile to bring in mobile.aar, remove all traces of go-mobile

* Version bump
  • Loading branch information
asutula authored Apr 5, 2019
1 parent b3e8b96 commit d0e60a2
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 117 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repositories {

dependencies {
implementation "com.facebook.react:react-native:+" // From node_modules
api project(':mobile')
implementation 'io.textile:textile:0.1.1'
}

task wrapper(type: Wrapper) {
Expand Down
2 changes: 0 additions & 2 deletions android/mobile/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rootProject.name = 'RNTextile'
include ':mobile'
30 changes: 4 additions & 26 deletions config/DOCS_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,14 @@ Installation

`react-native link @textile/react-native-sdk`

**Update Search Paths in iOS**

The library requires you to update two Search Paths in your iOS code to locate Textile's mobile framework (installed as a dependency of the React Native library).

Open your project's XCode file. Then, in XCode, navigate to the `Root file -> Build Settings` in the search bar enter, `Search Paths`. You'll see a group of three entries, we are going to edit two.

1. In `Framework search paths` add `$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios`
2. In `Library search paths` add `$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios`
Note: The iOS component of `@textile/react-native-sdk` should be installed using Cocoapods. `react-native-link` should do this correctly. More documentation coming here.

**Update Android Gradle**

Open your project and navigate to `android/settings.gradle`. At the end, you will add,

```
include ':mobile'
```

Navigate to `app/build.gradle`. Add to the end of the `dependencies {` section,

```
api project(':mobile')
```

Finally, inside the `android` folder, you need to create a new folder called, `mobile`.

Inside the newly created `mobile` folder, create a file called, `build.gradle` and for the contents of `build.gradle` enter,
You'll need to add Textile's maven repository to your project `build.gradle`'s `allProjects.repositories` section:

```
configurations.maybeCreate("default")
artifacts.add("default", file('../../node_modules/@textile/go-mobile/dist/android/mobile.aar'))
maven { url "https://dl.bintray.com/textile/maven" }
```

**Other dependencies**
Expand All @@ -53,7 +31,7 @@ The Textile library also requires that your project has two other libraries inst

### Typescript Types

@textile/react-native-sdk is written in TypeScript and compiled to JavaScript. You can use either in your app.
@textile/react-native-sdk is written in TypeScript and compiled to JavaScript. You can use either in your app.

#### Import Model Types

Expand Down
30 changes: 6 additions & 24 deletions ios/RNTextile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,9 @@
58B511F01A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios/**",
"$(SRCROOT)/../../go-mobile/dist/ios/**",
);
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios/**",
"$(SRCROOT)/../../go-mobile/dist/ios/**",
);
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios/**",
"$(SRCROOT)/../../go-mobile/dist/ios/**",
);
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RNTextile;
SKIP_INSTALL = YES;
Expand All @@ -230,18 +221,9 @@
58B511F11A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios/**",
"$(SRCROOT)/../../go-mobile/dist/ios/**",
);
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios/**",
"$(SRCROOT)/../../go-mobile/dist/ios/**",
);
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../node_modules/@textile/go-mobile/dist/ios/**",
"$(SRCROOT)/../../go-mobile/dist/ios/**",
);
FRAMEWORK_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RNTextile;
SKIP_INSTALL = YES;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@textile/react-native-sdk",
"version": "1.1.2",
"version": "1.1.3",
"description": "## Getting started",
"nativePackage": true,
"main": "dist/index.js",
Expand Down Expand Up @@ -69,7 +69,7 @@
"typescript": "^3.1.1"
},
"dependencies": {
"@textile/go-mobile": "0.1.11",
"@textile/js-types": "0.1.11",
"buffer": "^5.2.1"
},
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/Textile/Models/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pb from '@textile/go-mobile'
import pb from '@textile/js-types'

export * from './SDK'
export { pb }
Loading

0 comments on commit d0e60a2

Please sign in to comment.