Skip to content

Commit

Permalink
fix: some build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Jul 15, 2022
1 parent 3076597 commit 1e9cc49
Show file tree
Hide file tree
Showing 71 changed files with 17,138 additions and 589 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -3,7 +3,7 @@ version: 2.1
executors:
default:
docker:
- image: circleci/node:10
- image: circleci/node:16
working_directory: ~/project

commands:
Expand Down
15 changes: 8 additions & 7 deletions .gitignore
Expand Up @@ -31,33 +31,34 @@ project.xcworkspace

# Android/IJ
#
.idea
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
#
example/ios/Pods
example/ios/Podfile.lock

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
package-lock.json
yarn.lock

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
docs/api/
gitpull.sh
gitpush.sh

# Expo
.expo/*
Expand Down
1 change: 1 addition & 0 deletions .watchmanconfig
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions .yarnrc
@@ -0,0 +1,3 @@
# Override Yarn command so we can automatically setup the repo on running `yarn`

yarn-path "scripts/bootstrap.js"
27 changes: 19 additions & 8 deletions CONTRIBUTING.md
Expand Up @@ -4,13 +4,15 @@ We want this community to be friendly and respectful to each other. Please follo

## Development workflow

To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package:
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:

```sh
yarn bootstrap
yarn
```

While developing, you can run the [example app](/example/) to test your changes.
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.

To start the packager:

Expand All @@ -30,6 +32,7 @@ To run the example app on iOS:
yarn example ios
```


Make sure your code passes TypeScript and ESLint. Run the following to verify:

```sh
Expand All @@ -48,11 +51,9 @@ Remember to add tests for your change if possible. Run the unit tests by:
```sh
yarn test
```

To edit the Objective-C files, open `example/ios/AgoraExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-agora`.

To edit the Kotlin files, open `example/android` in Android studio and find the source files at `react-native-agora` under `Android`.

To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativeagora` under `Android`.
### Commit message convention

We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
Expand All @@ -61,7 +62,7 @@ We follow the [conventional commits specification](https://www.conventionalcommi
- `feat`: new features, e.g. add new method to the module.
- `refactor`: code refactor, e.g. migrate from class components to hooks.
- `docs`: changes into documentation, e.g. add usage example for the module..
- `test`: adding or updating tests, eg add integration tests using detox.
- `test`: adding or updating tests, e.g. add integration tests using detox.
- `chore`: tooling changes, e.g. change CI config.

Our pre-commit hooks verify that your commit message matches this format when committing.
Expand All @@ -74,6 +75,16 @@ We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint]

Our pre-commit hooks verify that the linter and tests pass when committing.

### Publishing to npm

We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.

To publish new versions, run the following:

```sh
yarn release
```

### Scripts

The `package.json` file contains various scripts for common tasks:
Expand All @@ -88,7 +99,7 @@ The `package.json` file contains various scripts for common tasks:

### Sending a pull request

> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
When you're sending a pull request:

Expand Down
3 changes: 1 addition & 2 deletions LICENSE
@@ -1,7 +1,6 @@
MIT License

Copyright (c) 2020 syanbo luxuhui

Copyright (c) 2022 Agora
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
46 changes: 30 additions & 16 deletions android/build.gradle
Expand Up @@ -3,20 +3,28 @@ buildscript {
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['Agora_kotlinVersion']

repositories {
mavenCentral()
google()
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.5.3'
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Agora_' + name]
}
Expand All @@ -27,24 +35,23 @@ def getExtOrIntegerDefault(name) {

android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')

defaultConfig {
minSdkVersion 16
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
versionCode 1
versionName "1.0"

buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
consumerProguardFiles 'consumer-rules.pro'
}

buildTypes {
release {
minifyEnabled false
}
}

lintOptions {
disable 'GradleCompatible'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -54,7 +61,6 @@ android {
repositories {
mavenCentral()
google()
maven { url 'https://www.jitpack.io' }

def found = false
def defaultDir = null
Expand Down Expand Up @@ -117,18 +123,26 @@ repositories {
if (!found) {
throw new GradleException(
"${project.name}: unable to locate React Native android sources. " +
"Ensure you have you installed React Native as a dependency in your project and try again."
"Ensure you have you installed React Native as a dependency in your project and try again."
)
}
}

def kotlin_version = getExtOrDefault('kotlinVersion')

dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
api 'io.agora.rtc:full-sdk:3.7.0'
implementation 'io.agora.rtc:full-screen-sharing:3.7.0'

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// From node_modules
api 'io.agora.rtc:full-sdk:3.7.0.3'
api 'io.agora.rtc:full-screen-sharing:3.7.0.3'
}

if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
libraryName = "RCTAgora"
codegenJavaPackageName = "io.agora.rtc.react"
}
}
9 changes: 5 additions & 4 deletions android/gradle.properties
@@ -1,4 +1,5 @@
Agora_kotlinVersion=1.3.50
Agora_compileSdkVersion=28
Agora_buildToolsVersion=28.0.3
Agora_targetSdkVersion=28
Agora_kotlinVersion=1.7.0
Agora_minSdkVersion=21
Agora_targetSdkVersion=31
Agora_compileSdkVersion=31
Agora_ndkversion=21.4.7075529
2 changes: 2 additions & 0 deletions example/.bundle/config
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
1 change: 1 addition & 0 deletions example/.ruby-version
@@ -0,0 +1 @@
2.7.4

0 comments on commit 1e9cc49

Please sign in to comment.