Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/actions/gradle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Gradle Build
description: Executes a Gradle build
inputs:
project-root:
description: The path to the root of the project
required: true
runs:
using: composite
steps:
- name: Determine build root directory
id: build-root-directory-finder
run: |
if [[ -f android/build.gradle ]]; then
echo "::set-output name=build-root-directory::${{ inputs.project-root }}/android"
else
echo "::set-output name=build-root-directory::${{ inputs.project-root }}"
fi
shell: bash
working-directory: ${{ inputs.project-root }}
- name: Configure JVM memory
env:
JVM_ARGS: org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
run: |
echo $JVM_ARGS >> ${{ steps.build-root-directory-finder.outputs.build-root-directory }}/gradle.properties
shell: bash
- name: Build
uses: gradle/[email protected]
with:
gradle-version: wrapper
arguments: --no-daemon clean build check test
build-root-directory: ${{ steps.build-root-directory-finder.outputs.build-root-directory }}
15 changes: 6 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,9 @@ jobs:
shell: bash
working-directory: example
- name: Build
run: |
./gradlew clean build check test
shell: bash
working-directory: example/android
uses: ./.github/actions/gradle
with:
project-root: example
android-template:
name: "Android [template]"
strategy:
Expand All @@ -242,11 +241,9 @@ jobs:
shell: bash
working-directory: template-example
- name: Build
run: |
[[ -d android ]] && pushd android 1> /dev/null
./gradlew clean build check test
shell: bash
working-directory: template-example
uses: ./.github/actions/gradle
with:
project-root: template-example
- name: react-native run-android
run: |
../test/react-native.js run-android
Expand Down
5 changes: 4 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ project.ext.react = [

android {
compileSdkVersion project.ext.compileSdkVersion
buildToolsVersion project.ext.buildToolsVersion

// We need only set `ndkVersion` when building react-native from source.
if (hasProperty("ANDROID_NDK_VERSION")) {
Expand Down Expand Up @@ -94,6 +93,10 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

lintOptions {
lintConfig file("lint.xml")
}

packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
Expand Down
6 changes: 6 additions & 0 deletions android/app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="UnusedResources">
<ignore path="**/generated/rncli/src/main/res/raw/app.json" />
</issue>
</lint>
4 changes: 3 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

<activity android:name="com.microsoft.reacttestapp.MainActivity">
<activity
android:name="com.microsoft.reacttestapp.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
3 changes: 1 addition & 2 deletions android/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ext {
]

compileSdkVersion = 31
buildToolsVersion = "30.0.3"
minSdkVersion = 23
targetSdkVersion = 29

Expand Down Expand Up @@ -42,6 +41,6 @@ ext {
moshiKotlinCodegen : "com.squareup.moshi:moshi-kotlin-codegen:1.12.0",
]

androidPluginVersion = "4.2.2"
androidPluginVersion = "7.0.4"
kotlinVersion = versionOf(libraries.kotlinStdlibJdk7)
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading