build.gradle: remove product flavors

This commit is contained in:
Andreas Schildbach 2024-06-12 17:53:44 +02:00
parent d92615efd9
commit b0ea770ba3
9 changed files with 5 additions and 90 deletions

View file

@ -48,4 +48,4 @@ RUN if [ -e /dev/fuse ] ; \
# export build output
FROM scratch AS export-stage
COPY --from=build-stage /home/builder/project/oeffi/build/outputs/apk/*/release/oeffi-*-release-unsigned.apk /
COPY --from=build-stage /home/builder/project/oeffi/build/outputs/apk/release/oeffi-release-unsigned.apk /

View file

@ -53,18 +53,6 @@ android {
}
}
flavorDimensions 'flavor'
productFlavors {
aosp {
dimension 'flavor'
versionNameSuffix '-aosp'
}
google {
dimension 'flavor'
versionNameSuffix '-google'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
@ -75,12 +63,6 @@ android {
test {
java.srcDirs = ['test']
}
aosp {
java.srcDirs = ['src-aosp']
}
google {
java.srcDirs = ['src-google']
}
}
compileOptions {

View file

@ -1,21 +0,0 @@
/*
* Copyright the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.schildbach.oeffi;
public class Variants {
}

View file

@ -1,21 +0,0 @@
/*
* Copyright the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.schildbach.oeffi;
public class Variants {
}

View file

@ -197,13 +197,4 @@ public class Application extends android.app.Application {
public static final int versionCode(final Application application) {
return application.packageInfo().versionCode;
}
public static final String versionFlavor(final Application application) {
final String applicationVersion = versionName(application);
final int applicationVersionSplit = applicationVersion.indexOf('-');
if (applicationVersionSplit >= 0)
return applicationVersion.substring(applicationVersionSplit + 1);
else
return null;
}
}

View file

@ -50,8 +50,7 @@ public abstract class OeffiActivity extends ComponentActivity {
this.application = (Application) getApplication();
this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
ErrorReporter.getInstance().check(this, applicationVersionCode(), applicationVersionFlavor(),
application.okHttpClient());
ErrorReporter.getInstance().check(this, applicationVersionCode(), application.okHttpClient());
}
protected void updateFragments(final int listFrameResId, final int mapFrameResId) {
@ -100,10 +99,6 @@ public abstract class OeffiActivity extends ComponentActivity {
return Application.versionCode(application);
}
protected final String applicationVersionFlavor() {
return Application.versionFlavor(application);
}
protected final long applicationFirstInstallTime() {
return application.packageInfo().firstInstallTime;
}

View file

@ -341,18 +341,11 @@ public abstract class OeffiMainActivity extends OeffiActivity {
private void downloadAndProcessMessages(final String network) {
final HttpUrl.Builder remoteUrl = Constants.MESSAGES_BASE_URL.newBuilder();
final StringBuilder remoteFileName = new StringBuilder("messages");
final String flavor = applicationVersionFlavor();
if (flavor != null)
remoteFileName.append('-').append(flavor);
remoteFileName.append(".txt");
remoteUrl.addPathSegment(remoteFileName.toString());
remoteUrl.addPathSegment("messages.txt");
final String installerPackageName = Installer.installerPackageName(this);
if (installerPackageName != null)
remoteUrl.addEncodedQueryParameter("installer", installerPackageName);
remoteUrl.addQueryParameter("version", Integer.toString(versionCode));
if (flavor != null)
remoteUrl.addQueryParameter("flavor", flavor);
remoteUrl.addQueryParameter("sdk", Integer.toString(Build.VERSION.SDK_INT));
remoteUrl.addQueryParameter("task", taskName());
final File localFile = new File(getFilesDir(), "messages.txt");

View file

@ -315,15 +315,12 @@ public class ErrorReporter implements Thread.UncaughtExceptionHandler {
private final static Pattern PATTERN_VERSION = Pattern.compile("<dt id=\"(\\d+)\">([^<]*)</dt>");
public void check(final Context context, final int applicationVersionCode, final String applicationVersionFlavor,
final OkHttpClient okHttpClient) {
public void check(final Context context, final int applicationVersionCode, final OkHttpClient okHttpClient) {
if (!stackTraceFile.exists())
return;
final HttpUrl.Builder url = HttpUrl.parse(context.getString(R.string.about_changelog_summary)).newBuilder();
url.addQueryParameter("version", Integer.toString(applicationVersionCode));
if (applicationVersionFlavor != null)
url.addQueryParameter("flavor", applicationVersionFlavor);
url.addQueryParameter("sdk", Integer.toString(Build.VERSION.SDK_INT));
url.addQueryParameter("check", null);
final Request.Builder request = new Request.Builder().url(url.build());

View file

@ -9,8 +9,7 @@ if (GradleVersion.current() < minGradleVersion || GradleVersion.current() >= max
throw new GradleScriptException("build requires Gradle between ${minGradleVersion.version} (including) and ${maxGradleVersion.version} (excluding)", null)
gradle.startParameter.excludedTaskNames << "lint"
gradle.startParameter.excludedTaskNames << ":oeffi:lintVitalAospRelease"
gradle.startParameter.excludedTaskNames << ":oeffi:lintVitalGoogleRelease"
gradle.startParameter.excludedTaskNames << ":oeffi:lintVitalRelease"
include 'oeffi'
include 'public-transport-enabler'