mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	Support versionCode and versionName in brackets
Example: versionCode(29) https://github.com/florisboard/florisboard/blob/v0.3.9/app/build.gradle.kts#L24
This commit is contained in:
		
							parent
							
								
									6ba647baec
								
							
						
					
					
						commit
						ea9f917ddc
					
				
					 4 changed files with 110 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -744,6 +744,7 @@ include tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata
 | 
			
		|||
include tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/short_description.txt
 | 
			
		||||
include tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/title.txt
 | 
			
		||||
include tests/source-files/com.seafile.seadroid2/app/build.gradle
 | 
			
		||||
include tests/source-files/dev.patrickgold.florisboard/app/build.gradle.kts
 | 
			
		||||
include tests/source-files/eu.siacs.conversations/build.gradle
 | 
			
		||||
include tests/source-files/eu.siacs.conversations/metadata/en-US/name.txt
 | 
			
		||||
include tests/source-files/fdroid/fdroidclient/AndroidManifest.xml
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1488,8 +1488,8 @@ def remove_debuggable_flags(root_dir):
 | 
			
		|||
                        os.path.join(root, 'AndroidManifest.xml'))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
vcsearch_g = re.compile(r'''\b[Vv]ersionCode\s*=?\s*["']*([0-9_]+)["']*''').search
 | 
			
		||||
vnsearch_g = re.compile(r'''\b[Vv]ersionName\s*=?\s*(["'])((?:(?=(\\?))\3.)*?)\1''').search
 | 
			
		||||
vcsearch_g = re.compile(r'''\b[Vv]ersionCode\s*=?\s*["'(]*([0-9_]+)["')]*''').search
 | 
			
		||||
vnsearch_g = re.compile(r'''\b[Vv]ersionName\s*=?\s*\(?(["'])((?:(?=(\\?))\3.)*?)\1''').search
 | 
			
		||||
vnssearch_g = re.compile(r'''\b[Vv]ersionNameSuffix\s*=?\s*(["'])((?:(?=(\\?))\3.)*?)\1''').search
 | 
			
		||||
psearch_g = re.compile(r'''\b(packageName|applicationId)\s*=*\s*["']([^"']+)["']''').search
 | 
			
		||||
fsearch_g = re.compile(r'''\b(applicationIdSuffix)\s*=*\s*["']([^"']+)["']''').search
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -926,6 +926,16 @@ class CommonTest(unittest.TestCase):
 | 
			
		|||
        self.assertEqual(('1.9.0', '170521', 'com.integreight.onesheeld'),
 | 
			
		||||
                         fdroidserver.common.parse_androidmanifests(paths, app))
 | 
			
		||||
 | 
			
		||||
        app = fdroidserver.metadata.App()
 | 
			
		||||
        app.id = 'dev.patrickgold.florisboard'
 | 
			
		||||
        paths = [
 | 
			
		||||
            os.path.join('source-files', 'dev.patrickgold.florisboard', 'app', 'build.gradle.kts'),
 | 
			
		||||
        ]
 | 
			
		||||
        for path in paths:
 | 
			
		||||
            self.assertTrue(os.path.isfile(path))
 | 
			
		||||
        self.assertEqual(('0.3.10', '29', 'dev.patrickgold.florisboard'),
 | 
			
		||||
                         fdroidserver.common.parse_androidmanifests(paths, app))
 | 
			
		||||
 | 
			
		||||
    def test_parse_androidmanifests_ignore(self):
 | 
			
		||||
        app = fdroidserver.metadata.App()
 | 
			
		||||
        app.id = 'org.fdroid.fdroid'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,97 @@
 | 
			
		|||
plugins {
 | 
			
		||||
    id("com.android.application") version "4.1.2"
 | 
			
		||||
    kotlin("android") version "1.4.30"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
android {
 | 
			
		||||
    compileSdkVersion(30)
 | 
			
		||||
    buildToolsVersion("30.0.3")
 | 
			
		||||
 | 
			
		||||
    compileOptions {
 | 
			
		||||
        sourceCompatibility = JavaVersion.VERSION_1_8
 | 
			
		||||
        targetCompatibility = JavaVersion.VERSION_1_8
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    kotlinOptions {
 | 
			
		||||
        jvmTarget = JavaVersion.VERSION_1_8.toString()
 | 
			
		||||
        freeCompilerArgs = listOf("-Xallow-result-return-type") // enables use of kotlin.Result
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    defaultConfig {
 | 
			
		||||
        applicationId = "dev.patrickgold.florisboard"
 | 
			
		||||
        minSdkVersion(23)
 | 
			
		||||
        targetSdkVersion(30)
 | 
			
		||||
        versionCode(29)
 | 
			
		||||
        versionName("0.3.10")
 | 
			
		||||
 | 
			
		||||
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    buildFeatures {
 | 
			
		||||
        viewBinding = true
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    buildTypes {
 | 
			
		||||
        named("debug").configure {
 | 
			
		||||
            applicationIdSuffix = ".debug"
 | 
			
		||||
            versionNameSuffix = "-debug"
 | 
			
		||||
 | 
			
		||||
            resValue("mipmap", "floris_app_icon", "@mipmap/ic_app_icon_debug")
 | 
			
		||||
            resValue("mipmap", "floris_app_icon_round", "@mipmap/ic_app_icon_debug_round")
 | 
			
		||||
            resValue("string", "floris_app_name", "FlorisBoard Debug")
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        create("beta") // Needed because by default the "beta" BuildType does not exist
 | 
			
		||||
        named("beta").configure {
 | 
			
		||||
            applicationIdSuffix = ".beta"
 | 
			
		||||
            versionNameSuffix = "-beta01"
 | 
			
		||||
            proguardFiles.add(getDefaultProguardFile("proguard-android-optimize.txt"))
 | 
			
		||||
 | 
			
		||||
            resValue("mipmap", "floris_app_icon", "@mipmap/ic_app_icon_beta")
 | 
			
		||||
            resValue("mipmap", "floris_app_icon_round", "@mipmap/ic_app_icon_beta_round")
 | 
			
		||||
            resValue("string", "floris_app_name", "FlorisBoard Beta")
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        named("release").configure {
 | 
			
		||||
            proguardFiles.add(getDefaultProguardFile("proguard-android-optimize.txt"))
 | 
			
		||||
 | 
			
		||||
            resValue("mipmap", "floris_app_icon", "@mipmap/ic_app_icon_release")
 | 
			
		||||
            resValue("mipmap", "floris_app_icon_round", "@mipmap/ic_app_icon_release_round")
 | 
			
		||||
            resValue("string", "floris_app_name", "@string/app_name")
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    testOptions {
 | 
			
		||||
        unitTests {
 | 
			
		||||
            isIncludeAndroidResources = true
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    lintOptions {
 | 
			
		||||
        isAbortOnError = false
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dependencies {
 | 
			
		||||
    implementation("androidx.activity", "activity-ktx", "1.2.1")
 | 
			
		||||
    implementation("androidx.appcompat", "appcompat", "1.2.0")
 | 
			
		||||
    implementation("androidx.core", "core-ktx", "1.3.2")
 | 
			
		||||
    implementation("androidx.fragment", "fragment-ktx", "1.3.0")
 | 
			
		||||
    implementation("androidx.preference", "preference-ktx", "1.1.1")
 | 
			
		||||
    implementation("androidx.constraintlayout", "constraintlayout", "2.0.4")
 | 
			
		||||
    implementation("androidx.lifecycle", "lifecycle-service", "2.2.0")
 | 
			
		||||
    implementation("com.google.android", "flexbox", "2.0.1") // requires jcenter as of version 2.0.1
 | 
			
		||||
    implementation("com.squareup.moshi", "moshi-kotlin", "1.11.0")
 | 
			
		||||
    implementation("com.squareup.moshi", "moshi-adapters", "1.11.0")
 | 
			
		||||
    implementation("com.google.android.material", "material", "1.3.0")
 | 
			
		||||
    implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-android", "1.4.2")
 | 
			
		||||
    implementation("com.jaredrummler", "colorpicker", "1.1.0")
 | 
			
		||||
    implementation("com.jakewharton.timber", "timber", "4.7.1")
 | 
			
		||||
    implementation("com.nambimobile.widgets", "expandable-fab", "1.0.2")
 | 
			
		||||
 | 
			
		||||
    testImplementation("junit", "junit", "4.13.1")
 | 
			
		||||
    testImplementation("org.mockito", "mockito-inline", "3.7.7")
 | 
			
		||||
    testImplementation("org.robolectric", "robolectric", "4.5.1")
 | 
			
		||||
    androidTestImplementation("androidx.test.ext", "junit", "1.1.2")
 | 
			
		||||
    androidTestImplementation("androidx.test.espresso", "espresso-core", "3.3.0")
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue