Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
1428cf04
Commit
1428cf04
authored
Dec 12, 2016
by
laggedHero
Committed by
GitHub
Dec 12, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #80 from RocketChat/feature/ci-build-prepare
Preparing new build
parents
4e4dd2f5
cc1775c8
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
97 additions
and
20 deletions
+97
-20
.gitignore
.gitignore
+6
-0
build.gradle
app/build.gradle
+15
-1
RocketChatApplication.java
.../main/java/chat/rocket/android/RocketChatApplication.java
+2
-7
AbstractFragmentActivity.java
...hat/rocket/android/activity/AbstractFragmentActivity.java
+18
-9
AddServerActivity.java
.../java/chat/rocket/android/activity/AddServerActivity.java
+1
-1
ServerConfigActivity.java
...va/chat/rocket/android/activity/ServerConfigActivity.java
+1
-1
InstabugWrapper.java
...od/java/chat/rocket/android/wrappers/InstabugWrapper.java
+16
-0
InstabugWrapper.java
...qa/java/chat/rocket/android/wrappers/InstabugWrapper.java
+23
-0
circle.yml
circle.yml
+2
-0
quality.gradle
config/quality/quality.gradle
+1
-1
dependencies.gradle
dependencies.gradle
+12
-0
No files found.
.gitignore
View file @
1428cf04
...
@@ -33,3 +33,9 @@ proguard/
...
@@ -33,3 +33,9 @@ proguard/
# MacOS
# MacOS
.DS_Store
.DS_Store
# Auth files
*.jks
app/rocket-chat.json
app/src/release/google-services.json
app/src/release/res/values/api_key_strings.xml
app/build.gradle
View file @
1428cf04
...
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
...
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply
plugin:
'me.tatarka.retrolambda'
apply
plugin:
'me.tatarka.retrolambda'
apply
plugin:
'realm-android'
apply
plugin:
'realm-android'
apply
plugin:
'com.jakewharton.hugo'
apply
plugin:
'com.jakewharton.hugo'
apply
plugin:
'com.github.triplet.play'
apply
from:
'../config/quality/quality.gradle'
apply
from:
'../config/quality/quality.gradle'
buildscript
{
buildscript
{
...
@@ -19,6 +20,7 @@ buildscript {
...
@@ -19,6 +20,7 @@ buildscript {
classpath
rootProject
.
ext
.
realmPlugin
classpath
rootProject
.
ext
.
realmPlugin
classpath
'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath
'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath
'com.google.gms:google-services:3.0.0'
classpath
'com.google.gms:google-services:3.0.0'
classpath
'com.github.triplet.gradle:play-publisher:1.1.5'
}
}
// Exclude the version that the android plugin depends on.
// Exclude the version that the android plugin depends on.
...
@@ -59,6 +61,14 @@ android {
...
@@ -59,6 +61,14 @@ android {
signingConfig
signingConfigs
.
release
signingConfig
signingConfigs
.
release
}
}
}
}
productFlavors
{
qa
{
// something - qa builds will have some extra stuff for alpha testers
}
prod
{
// another
}
}
packagingOptions
{
packagingOptions
{
exclude
'META-INF/LICENSE.txt'
exclude
'META-INF/LICENSE.txt'
exclude
'META-INF/NOTICE.txt'
exclude
'META-INF/NOTICE.txt'
...
@@ -72,6 +82,10 @@ android {
...
@@ -72,6 +82,10 @@ android {
lintConfig
file
(
"lint.xml"
)
lintConfig
file
(
"lint.xml"
)
}
}
}
}
play
{
jsonFile
=
file
(
'rocket-chat.json'
)
track
=
"${track}"
}
repositories
{
repositories
{
mavenCentral
()
mavenCentral
()
...
@@ -89,7 +103,7 @@ dependencies {
...
@@ -89,7 +103,7 @@ dependencies {
compile
rootProject
.
ext
.
supportAppCompat
compile
rootProject
.
ext
.
supportAppCompat
compile
rootProject
.
ext
.
supportDesign
compile
rootProject
.
ext
.
supportDesign
c
ompile
(
'com.instabug.library:instabug:3.1.0'
)
{
qaC
ompile
(
'com.instabug.library:instabug:3.1.0'
)
{
exclude
group:
'io.reactivex'
exclude
group:
'io.reactivex'
}
}
compile
'com.android.support:multidex:1.0.1'
compile
'com.android.support:multidex:1.0.1'
...
...
app/src/main/java/chat/rocket/android/RocketChatApplication.java
View file @
1428cf04
...
@@ -4,13 +4,11 @@ import android.support.multidex.MultiDexApplication;
...
@@ -4,13 +4,11 @@ import android.support.multidex.MultiDexApplication;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
com.facebook.stetho.Stetho
;
import
com.facebook.stetho.Stetho
;
import
com.instabug.library.Feature
;
import
com.instabug.library.Instabug
;
import
com.instabug.library.invocation.InstabugInvocationEvent
;
import
com.uphyca.stetho_realm.RealmInspectorModulesProvider
;
import
com.uphyca.stetho_realm.RealmInspectorModulesProvider
;
import
io.realm.Realm
;
import
io.realm.Realm
;
import
io.realm.RealmConfiguration
;
import
io.realm.RealmConfiguration
;
import
java.util.List
;
import
java.util.List
;
import
chat.rocket.android.wrappers.InstabugWrapper
;
/**
/**
* Customized Application-class for Rocket.Chat
* Customized Application-class for Rocket.Chat
...
@@ -34,10 +32,7 @@ public class RocketChatApplication extends MultiDexApplication {
...
@@ -34,10 +32,7 @@ public class RocketChatApplication extends MultiDexApplication {
.
enableWebKitInspector
(
RealmInspectorModulesProvider
.
builder
(
this
).
build
())
.
enableWebKitInspector
(
RealmInspectorModulesProvider
.
builder
(
this
).
build
())
.
build
());
.
build
());
new
Instabug
.
Builder
(
this
,
getString
(
R
.
string
.
instabug_api_key
))
InstabugWrapper
.
build
(
this
,
getString
(
R
.
string
.
instabug_api_key
));
.
setInvocationEvent
(
InstabugInvocationEvent
.
FLOATING_BUTTON
)
.
setInAppMessagingState
(
Feature
.
State
.
DISABLED
)
//not available in Free plan...
.
build
();
//TODO: add periodic trigger for RocketChatService.keepalive(this) here!
//TODO: add periodic trigger for RocketChatService.keepalive(this) here!
}
}
...
...
app/src/main/java/chat/rocket/android/activity/AbstractFragmentActivity.java
View file @
1428cf04
...
@@ -6,29 +6,37 @@ import android.support.annotation.Nullable;
...
@@ -6,29 +6,37 @@ import android.support.annotation.Nullable;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.app.FragmentManager
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
chat.rocket.android.helper.OnBackPressListener
;
import
chat.rocket.android.helper.OnBackPressListener
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.log.RCLog
;
import
com.instabug.library.InstabugTrackingDelegate
;
import
com.trello.rxlifecycle.components.support.RxAppCompatActivity
;
import
com.trello.rxlifecycle.components.support.RxAppCompatActivity
;
import
chat.rocket.android.wrappers.InstabugWrapper
;
import
icepick.Icepick
;
import
icepick.Icepick
;
abstract
class
AbstractFragmentActivity
extends
RxAppCompatActivity
{
abstract
class
AbstractFragmentActivity
extends
RxAppCompatActivity
{
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
Icepick
.
restoreInstanceState
(
this
,
savedInstanceState
);
Icepick
.
restoreInstanceState
(
this
,
savedInstanceState
);
}
}
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
super
.
onSaveInstanceState
(
outState
);
Icepick
.
saveInstanceState
(
this
,
outState
);
Icepick
.
saveInstanceState
(
this
,
outState
);
}
}
protected
abstract
@IdRes
int
getLayoutContainerForFragment
();
protected
abstract
@IdRes
int
getLayoutContainerForFragment
();
@Override
public
final
void
onBackPressed
()
{
@Override
public
final
void
onBackPressed
()
{
if
(!
onBackPress
())
{
if
(!
onBackPress
())
{
onBackPresseNotHandled
();
onBackPresse
d
NotHandled
();
}
}
}
}
...
@@ -49,7 +57,7 @@ abstract class AbstractFragmentActivity extends RxAppCompatActivity {
...
@@ -49,7 +57,7 @@ abstract class AbstractFragmentActivity extends RxAppCompatActivity {
return
false
;
return
false
;
}
}
protected
void
onBackPresseNotHandled
()
{
protected
void
onBackPresse
d
NotHandled
()
{
super
.
onBackPressed
();
super
.
onBackPressed
();
}
}
...
@@ -66,9 +74,10 @@ abstract class AbstractFragmentActivity extends RxAppCompatActivity {
...
@@ -66,9 +74,10 @@ abstract class AbstractFragmentActivity extends RxAppCompatActivity {
.
commit
();
.
commit
();
}
}
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
event
)
{
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
event
)
{
try
{
try
{
Instabug
TrackingDelegate
.
notifyActivityGotTouchEvent
(
event
,
this
);
Instabug
Wrapper
.
wrap
(
event
,
this
);
}
catch
(
IllegalStateException
exception
)
{
}
catch
(
IllegalStateException
exception
)
{
RCLog
.
w
(
exception
,
"Instabug error (ignored)"
);
RCLog
.
w
(
exception
,
"Instabug error (ignored)"
);
}
}
...
...
app/src/main/java/chat/rocket/android/activity/AddServerActivity.java
View file @
1428cf04
...
@@ -101,7 +101,7 @@ public class AddServerActivity extends AbstractFragmentActivity {
...
@@ -101,7 +101,7 @@ public class AddServerActivity extends AbstractFragmentActivity {
fragment
.
setArguments
(
args
);
fragment
.
setArguments
(
args
);
}
}
@Override
protected
void
onBackPresseNotHandled
()
{
@Override
protected
void
onBackPresse
d
NotHandled
()
{
moveTaskToBack
(
true
);
moveTaskToBack
(
true
);
}
}
}
}
app/src/main/java/chat/rocket/android/activity/ServerConfigActivity.java
View file @
1428cf04
...
@@ -104,7 +104,7 @@ public class ServerConfigActivity extends AbstractFragmentActivity {
...
@@ -104,7 +104,7 @@ public class ServerConfigActivity extends AbstractFragmentActivity {
fragment
.
setArguments
(
args
);
fragment
.
setArguments
(
args
);
}
}
@Override
protected
void
onBackPresseNotHandled
()
{
@Override
protected
void
onBackPresse
d
NotHandled
()
{
moveTaskToBack
(
true
);
moveTaskToBack
(
true
);
}
}
}
}
app/src/prod/java/chat/rocket/android/wrappers/InstabugWrapper.java
0 → 100644
View file @
1428cf04
package
chat
.
rocket
.
android
.
wrappers
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.view.MotionEvent
;
public
class
InstabugWrapper
{
public
static
void
build
(
Application
application
,
String
apiKey
)
{
// stub
}
public
static
void
wrap
(
MotionEvent
event
,
Activity
activity
)
{
// stub
}
}
app/src/qa/java/chat/rocket/android/wrappers/InstabugWrapper.java
0 → 100644
View file @
1428cf04
package
chat
.
rocket
.
android
.
wrappers
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.view.MotionEvent
;
import
com.instabug.library.Feature
;
import
com.instabug.library.Instabug
;
import
com.instabug.library.InstabugTrackingDelegate
;
import
com.instabug.library.invocation.InstabugInvocationEvent
;
public
class
InstabugWrapper
{
public
static
void
build
(
Application
application
,
String
apiKey
)
{
new
Instabug
.
Builder
(
application
,
apiKey
)
.
setInvocationEvent
(
InstabugInvocationEvent
.
FLOATING_BUTTON
)
.
setInAppMessagingState
(
Feature
.
State
.
DISABLED
)
//not available in Free plan...
.
build
();
}
public
static
void
wrap
(
MotionEvent
event
,
Activity
activity
)
{
InstabugTrackingDelegate
.
notifyActivityGotTouchEvent
(
event
,
activity
);
}
}
circle.yml
View file @
1428cf04
...
@@ -7,12 +7,14 @@
...
@@ -7,12 +7,14 @@
machine
:
machine
:
environment
:
environment
:
ANDROID_HOME
:
/usr/local/android-sdk-linux
ANDROID_HOME
:
/usr/local/android-sdk-linux
GRADLE_OPTS
:
'
-Dorg.gradle.jvmargs="-Xmx2048m
-XX:+HeapDumpOnOutOfMemoryError"'
dependencies
:
dependencies
:
pre
:
pre
:
-
echo "sdk.dir="$ANDROID_HOME > local.properties
-
echo "sdk.dir="$ANDROID_HOME > local.properties
-
echo $ROCKET_JKS_BASE64 | base64 --decode > Rocket.jks
-
echo $ROCKET_JKS_BASE64 | base64 --decode > Rocket.jks
-
echo $ROCKET_PLAY_JSON | base64 --decode > app/rocket-chat.json
-
mkdir -p app/src/release/res/values
-
mkdir -p app/src/release/res/values
-
echo $GOOGLE_SERVICES_BASE64 | base64 --decode > app/src/release/google-services.json
-
echo $GOOGLE_SERVICES_BASE64 | base64 --decode > app/src/release/google-services.json
...
...
config/quality/quality.gradle
View file @
1428cf04
...
@@ -40,7 +40,7 @@ task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code
...
@@ -40,7 +40,7 @@ task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code
task
findbugs
(
type:
FindBugs
,
task
findbugs
(
type:
FindBugs
,
group:
'Verification'
,
group:
'Verification'
,
description:
'Inspect java bytecode for bugs'
,
description:
'Inspect java bytecode for bugs'
,
dependsOn:
[
'compile
DebugSources'
,
'compileRelease
Sources'
])
{
dependsOn:
[
'compile
QaDebug
Sources'
])
{
ignoreFailures
=
false
ignoreFailures
=
false
effort
=
"max"
effort
=
"max"
...
...
dependencies.gradle
View file @
1428cf04
...
@@ -19,6 +19,8 @@ ext {
...
@@ -19,6 +19,8 @@ ext {
okhttp3
=
'com.squareup.okhttp3:okhttp:3.4.1'
okhttp3
=
'com.squareup.okhttp3:okhttp:3.4.1'
picasso
=
'com.squareup.picasso:picasso:2.5.2'
picasso
=
'com.squareup.picasso:picasso:2.5.2'
picasso2Okhttp3Downloader
=
'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
picasso2Okhttp3Downloader
=
'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
preDexLibs
=
!
"true"
.
equals
(
System
.
getenv
(
"CI"
))
}
}
subprojects
{
project
->
subprojects
{
project
->
...
@@ -32,4 +34,14 @@ subprojects { project ->
...
@@ -32,4 +34,14 @@ subprojects { project ->
}
}
}
}
}
}
}
subprojects
{
project
.
plugins
.
whenPluginAdded
{
plugin
->
if
(
"com.android.build.gradle.AppPlugin"
.
equals
(
plugin
.
class
.
name
))
{
project
.
android
.
dexOptions
.
preDexLibraries
=
rootProject
.
ext
.
preDexLibs
}
else
if
(
"com.android.build.gradle.LibraryPlugin"
.
equals
(
plugin
.
class
.
name
))
{
project
.
android
.
dexOptions
.
preDexLibraries
=
rootProject
.
ext
.
preDexLibs
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment