Skip to content

Commit

Permalink
build(App): Added config and fix bug for release in Android X issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Israel Calderon authored and Israel Calderon committed Aug 11, 2019
1 parent 3c977dd commit 9d5ff4d
Show file tree
Hide file tree
Showing 16 changed files with 204 additions and 7 deletions.
17 changes: 17 additions & 0 deletions android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TriQui</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1
6 changes: 6 additions & 0 deletions android/app/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
23 changes: 23 additions & 0 deletions android/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions android/app/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1
12 changes: 12 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ android {
keyAlias 'androiddebugkey'
keyPassword 'android'
}

release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
debug {
Expand All @@ -160,6 +169,7 @@ android {
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
Expand Down Expand Up @@ -188,6 +198,8 @@ android {
}

dependencies {
implementation project(':react-native-gesture-handler')
implementation project(':react-native-reanimated')
implementation project(':react-native-linear-gradient')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
Expand Down
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="com.triqui">

<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -9,7 +9,10 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
tools:targetApi="28"
android:theme="@style/AppTheme">

<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/triqui/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.swmansion.reanimated.ReanimatedPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
Expand Down
5 changes: 5 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@

android.useAndroidX=true
android.enableJetifier=true

MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=......
MYAPP_UPLOAD_KEY_PASSWORD=......
4 changes: 4 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
rootProject.name = 'TriQui'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
Expand Down
4 changes: 4 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ target 'TriQui' do

pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'

pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

target 'TriQuiTests' do
inherit! :search_paths
# Pods for testing
Expand Down
1 change: 1 addition & 0 deletions jetificableGroups.json

Large diffs are not rendered by default.

117 changes: 113 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
"version": "0.0.1",
"private": true,
"scripts": {
"postinstall": "npx react-native-jetifier",
"start": "react-native start",
"test": "jest",
"lint": "eslint src/"
"lint": "eslint src/",
"run:release": "react-native run-android --variant=release"
},
"dependencies": {
"@babel/plugin-proposal-decorators": "^7.4.4",
"@jumpn/react-native-jetifier": "^0.1.4",
"axios": "^0.19.0",
"babel-plugin-inline-import": "^3.0.0",
"jetifier": "^1.6.3",
"mobx": "^4.9.4",
"mobx-react": "^5.4.4",
"moment": "^2.24.0",
Expand Down
3 changes: 3 additions & 0 deletions src/api/QuizApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ class QuizApi {
*/
async generateQuiz() {
try {
console.log('testsets', 'dadada')
const { data } = await axios.get('https://opentdb.com/api.php?amount=10')
console.log(data)
if (data) {
const { results } = data
console.log(results)
return results
}
return []
Expand Down
2 changes: 1 addition & 1 deletion src/screens/DashBoard/DashBoard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import { inject, observer } from 'mobx-react'
// eslint-disable-next-line object-curly-newline
import { Container, View, H2, H1 } from 'native-base'
import { Container, View, H2, H1, } from 'native-base'
import { observable } from 'mobx'
import { LinearButton } from '../../components/Buttons'
import styles from './styles'
Expand Down

0 comments on commit 9d5ff4d

Please sign in to comment.