Skip to content

Commit

Permalink
Huge merge/refactor/update
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Jul 8, 2020
1 parent a5bfece commit 895c74d
Show file tree
Hide file tree
Showing 119 changed files with 1,008 additions and 807 deletions.
15 changes: 0 additions & 15 deletions .gitmodules

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ android:
components:
- tools
- platform-tools
- build-tools-29.0.2
- android-27
- android-28
- build-tools-29.0.3
- android-29
- extra-android-m2repository
113 changes: 80 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,63 +1,110 @@
/*
* Copyright 2013-2019 microG Project Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* SPDX-FileCopyrightText: 2013, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

buildscript {
ext.kotlin_version = '1.3.21'
ext.nlpVersion = '2.0-alpha1'
ext.remoteDroidGuardVersion = '0.1.1'
ext.safeParcelVersion = '1.6.0'
ext.wearableVersion = '0.1.1'

ext.kotlinVersion = '1.3.72'
ext.coroutineVersion = '1.3.7'

ext.annotationVersion = '1.1.0'
ext.appcompatVersion = '1.1.0'
ext.fragmentVersion = '1.2.5'
ext.lifecycleVersion = '2.2.0'
ext.mediarouterVersion = '1.1.0'
ext.multidexVersion = '2.0.1'
ext.navigationVersion = '2.3.0'
ext.preferenceVersion = '1.1.1'
ext.recyclerviewVersion = '1.1.0'

ext.supportLibraryVersion = "28.0.0"
ext.slf4jVersion = "1.7.25"

ext.androidBuildGradleVersion = "3.6.3"

ext.androidBuildVersionTools = "29.0.3"

ext.androidMinSdk = 14
ext.androidTargetSdk = 29
ext.androidCompileSdk = 29

repositories {
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.android.tools.build:gradle:$androidBuildGradleVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

def execResult(...args) {
def stdout = new ByteArrayOutputStream()
exec {
commandLine args
standardOutput = stdout
}
return stdout.toString().trim()
}

def gmsVersion = "19.4.20"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').substring(1)
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD"))
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0]
def gitDirty = execResult('git', 'status', '--porcelain').size() > 0
def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.'))
def ourVersionMinor = Integer.parseInt(ourVersionBase.substring(ourVersionBase.lastIndexOf('.') + 1))
def ourVersionCode = gmsVersionCode * 1000 + ourVersionMinor * 2 + (gitCommitCount > 0 || gitDirty ? 1 : 0)
def ourVersionName = "$ourVersionBase.$gmsVersionCode" + (gitCommitCount > 0 && !gitDirty ? "-$gitCommitCount" : "") + (gitDirty ? "-dirty" : "") + (gitCommitCount > 0 && !gitDirty ? " ($gitCommitId)" : "")
logger.lifecycle('Starting build for version {} ({})...', ourVersionName, ourVersionCode)

@Deprecated
String getMyVersionName() {
return ourVersionName
}

@Deprecated
int getMyVersionCode() {
return ourVersionCode
}


allprojects {
apply plugin: 'idea'
ext.androidBuildVersionTools = "29.0.2"
ext.supportLibraryVersion = "28.0.0"

group = 'org.microg.gms'
version = ourVersionName
ext.appVersionCode = ourVersionCode
ext.isReleaseVersion = false
ext.slf4jVersion = "1.7.25"
}

def androidCompileSdk() { return 28 }
@Deprecated
def androidCompileSdk() { return androidCompileSdk }

def androidTargetSdk() { return 29 }
@Deprecated
def androidTargetSdk() { return androidTargetSdk }

def androidMinSdk() { return 14 }
@Deprecated
def androidMinSdk() { return androidMinSdk }

@Deprecated
def versionCode() {
def stdout = new ByteArrayOutputStream()
exec { commandLine 'git', 'rev-list', '--count', "HEAD"; standardOutput = stdout }
return Integer.parseInt(stdout.toString().trim())
return ourVersionCode
}

@Deprecated
def versionName() {
def stdout = new ByteArrayOutputStream()
if (rootProject.file("gradlew").exists())
exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout }
else // automatic build system, don't tag dirty
exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout }
return stdout.toString().trim().substring(1)
return ourVersionName
}

subprojects {
group = 'org.microg'
repositories {
jcenter()
google()
Expand Down
1 change: 0 additions & 1 deletion extern/GmsApi
Submodule GmsApi deleted from 2a4344
1 change: 0 additions & 1 deletion extern/GmsLib
Submodule GmsLib deleted from 15cd44
1 change: 0 additions & 1 deletion extern/UnifiedNlp
Submodule UnifiedNlp deleted from 82479b
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip
13 changes: 2 additions & 11 deletions microg-ui-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

apply plugin: 'com.android.library'

String getMyVersionName() {
def stdout = new ByteArrayOutputStream()
if (rootProject.file("gradlew").exists())
exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout }
else // automatic build system, don't tag dirty
exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout }
return stdout.toString().trim().substring(1)
}

android {
compileSdkVersion androidCompileSdk
buildToolsVersion "$androidBuildVersionTools"
Expand All @@ -36,8 +27,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
}

List<Library> libraries = new ArrayList<Library>();
libraries.add(new Library(BuildConfig.APPLICATION_ID, getString(R.string.lib_name), getString(R.string.lib_license)));
collectLibraries(libraries);
Collections.sort(libraries);
((ListView) aboutRoot.findViewById(android.R.id.list)).setAdapter(new LibraryAdapter(getContext(), libraries.toArray(new Library[libraries.size()])));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.view.ViewGroup;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;

import java.util.ArrayList;
Expand All @@ -22,8 +21,6 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.dashboard_activity);
conditionContainer = (ViewGroup) findViewById(R.id.condition_container);

setSupportActionBar((Toolbar) findViewById(R.id.toolbar));

getSupportFragmentManager().beginTransaction()
.replace(R.id.content_wrapper, getFragment())
.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.view.ViewGroup;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

Expand All @@ -20,8 +19,6 @@ public abstract class AbstractSettingsActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_activity);

setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
if (showHomeAsUp) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Expand Down
2 changes: 0 additions & 2 deletions microg-ui-tools/src/main/res/layout/dashboard_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar"/>

<LinearLayout
android:id="@+id/condition_container"
android:layout_width="match_parent"
Expand Down
2 changes: 0 additions & 2 deletions microg-ui-tools/src/main/res/layout/settings_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar"/>

<org.microg.tools.ui.SwitchBar
android:id="@+id/switch_bar"
android:layout_width="match_parent"
Expand Down
3 changes: 1 addition & 2 deletions microg-ui-tools/src/main/res/layout/switch_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:background="@null"
android:theme="@style/Widget.AppCompat.Settings.SwitchBar.Switch"/>
android:background="@null"/>

</merge>
24 changes: 0 additions & 24 deletions microg-ui-tools/src/main/res/values-v14/themes.xml

This file was deleted.

34 changes: 0 additions & 34 deletions microg-ui-tools/src/main/res/values/themes.xml

This file was deleted.

24 changes: 6 additions & 18 deletions play-services-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,19 @@

apply plugin: 'com.android.library'

String getMyVersionName() {
def stdout = new ByteArrayOutputStream()
if (rootProject.file("gradlew").exists())
exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout }
else // automatic build system, don't tag dirty
exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout }
return stdout.toString().trim().substring(1)
}

group = 'org.microg'
version = getMyVersionName()

android {
compileSdkVersion androidCompileSdk()
compileSdkVersion androidCompileSdk
buildToolsVersion "$androidBuildVersionTools"

defaultConfig {
versionName getMyVersionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
versionName version
minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}

Expand Down
Loading

0 comments on commit 895c74d

Please sign in to comment.