Commit ec72820ce96456ae30f1af8cde1979f4e9c7cd8f
1 parent
bf0efe79
Exists in
master
sonar push
Showing
5 changed files
with
24 additions
and
7 deletions
Show diff stats
.idea/vcs.xml
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project version="4"> | 2 | <project version="4"> |
| 3 | <component name="VcsDirectoryMappings"> | 3 | <component name="VcsDirectoryMappings"> |
| 4 | - <mapping directory="$PROJECT_DIR$" vcs="Git" /> | 4 | + <mapping directory="" vcs="Git" /> |
| 5 | </component> | 5 | </component> |
| 6 | </project> | 6 | </project> |
| 7 | \ No newline at end of file | 7 | \ No newline at end of file |
app/build.gradle
| 1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
| 2 | - | 2 | +apply plugin: 'org.sonarqube' |
| 3 | android { | 3 | android { |
| 4 | compileSdkVersion 28 | 4 | compileSdkVersion 28 |
| 5 | defaultConfig { | 5 | defaultConfig { |
| @@ -25,14 +25,28 @@ android { | @@ -25,14 +25,28 @@ android { | ||
| 25 | manifestPlaceholders = [appLabel: "Sherbet app", appIcon: "@mipmap/ic_launcher"] | 25 | manifestPlaceholders = [appLabel: "Sherbet app", appIcon: "@mipmap/ic_launcher"] |
| 26 | versionCode 2 | 26 | versionCode 2 |
| 27 | versionName "1.2" | 27 | versionName "1.2" |
| 28 | - buildConfigField "String", "PRIMARYCOLOR", "\"#000000\"" | 28 | + // buildConfigField "String", "PRIMARYCOLOR", "\"#000000\"" |
| 29 | + //buildConfigField "String", "SERVER_URL", "\"http://dev.myserver.com\"" | ||
| 30 | + buildConfigField "String", "BUILD_VARIANT", "\"sherbet\"" | ||
| 29 | } | 31 | } |
| 30 | excel { | 32 | excel { |
| 31 | applicationId "driver.excel.multiflaver" | 33 | applicationId "driver.excel.multiflaver" |
| 32 | manifestPlaceholders = [appLabel: "Excel app", appIcon: "@mipmap/ic_launcher"] | 34 | manifestPlaceholders = [appLabel: "Excel app", appIcon: "@mipmap/ic_launcher"] |
| 33 | versionCode 10 | 35 | versionCode 10 |
| 34 | versionName "1.1.1" | 36 | versionName "1.1.1" |
| 35 | - buildConfigField "String", "PRIMARYCOLOR", "\"#FFFFFF\"" | 37 | + //buildConfigField "String", "PRIMARYCOLOR", "\"#FFFFFF\"" |
| 38 | + //buildConfigField "String", "SERVER_URL", "\"http://dev.myserver.com\"" | ||
| 39 | + buildConfigField "String", "BUILD_VARIANT", "\"excel\"" | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + sonarqube { | ||
| 43 | + properties { | ||
| 44 | + property "sonar.projectKey", "MultiFlaver" | ||
| 45 | + property "sonar.login", "1f97dce11a8c32441874165a97737d8a854f24b6" | ||
| 46 | + property "sonar.host.url", "http://localhost:9000" | ||
| 47 | + //property "sonar.java.binaries", "${sourceSets.main.output.classesDir}" | ||
| 48 | + //property "sonar.login", "admin" | ||
| 49 | + //property "sonar.password", "admin" | ||
| 36 | } | 50 | } |
| 37 | } | 51 | } |
| 38 | } | 52 | } |
app/src/main/java/com/excel/multiflaver/MainActivity.java
| @@ -4,6 +4,7 @@ import android.graphics.Color; | @@ -4,6 +4,7 @@ import android.graphics.Color; | ||
| 4 | import android.support.v7.app.AppCompatActivity; | 4 | import android.support.v7.app.AppCompatActivity; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.widget.Button; | 6 | import android.widget.Button; |
| 7 | +import android.widget.Toast; | ||
| 7 | 8 | ||
| 8 | public class MainActivity extends AppCompatActivity { | 9 | public class MainActivity extends AppCompatActivity { |
| 9 | 10 | ||
| @@ -13,8 +14,8 @@ public class MainActivity extends AppCompatActivity { | @@ -13,8 +14,8 @@ public class MainActivity extends AppCompatActivity { | ||
| 13 | protected void onCreate(Bundle savedInstanceState) { | 14 | protected void onCreate(Bundle savedInstanceState) { |
| 14 | super.onCreate(savedInstanceState); | 15 | super.onCreate(savedInstanceState); |
| 15 | setContentView(R.layout.activity_main); | 16 | setContentView(R.layout.activity_main); |
| 16 | - | ||
| 17 | button = (Button) findViewById(R.id.button); | 17 | button = (Button) findViewById(R.id.button); |
| 18 | - button.setTextColor(Color.parseColor(BuildConfig.PRIMARYCOLOR)); | 18 | + |
| 19 | + Toast.makeText(MainActivity.this, "Current Tenant is -- " + BuildConfig.BUILD_VARIANT, Toast.LENGTH_LONG).show(); | ||
| 19 | } | 20 | } |
| 20 | } | 21 | } |
app/src/main/res/layout/activity_main.xml
| @@ -110,7 +110,7 @@ | @@ -110,7 +110,7 @@ | ||
| 110 | android:drawableTint="@color/colorWhite" | 110 | android:drawableTint="@color/colorWhite" |
| 111 | android:text="Log in to your account" | 111 | android:text="Log in to your account" |
| 112 | android:textAllCaps="false" | 112 | android:textAllCaps="false" |
| 113 | - android:textColor="#fff" | 113 | + android:textColor="@color/colorAccent" |
| 114 | android:textSize="14sp" /> | 114 | android:textSize="14sp" /> |
| 115 | </LinearLayout> | 115 | </LinearLayout> |
| 116 | </RelativeLayout> | 116 | </RelativeLayout> |
build.gradle
| @@ -4,10 +4,12 @@ buildscript { | @@ -4,10 +4,12 @@ buildscript { | ||
| 4 | repositories { | 4 | repositories { |
| 5 | google() | 5 | google() |
| 6 | jcenter() | 6 | jcenter() |
| 7 | + maven { url "https://plugins.gradle.org/m2/" } | ||
| 7 | 8 | ||
| 8 | } | 9 | } |
| 9 | dependencies { | 10 | dependencies { |
| 10 | classpath 'com.android.tools.build:gradle:3.4.0' | 11 | classpath 'com.android.tools.build:gradle:3.4.0' |
| 12 | + classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6' | ||
| 11 | 13 | ||
| 12 | // NOTE: Do not place your application dependencies here; they belong | 14 | // NOTE: Do not place your application dependencies here; they belong |
| 13 | // in the individual module build.gradle files | 15 | // in the individual module build.gradle files |