mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	scan gradle.kts
This commit is contained in:
		
							parent
							
								
									0aca165b4e
								
							
						
					
					
						commit
						90bc8e1e8f
					
				
					 4 changed files with 124 additions and 1 deletions
				
			
		| 
						 | 
					@ -406,7 +406,7 @@ def scan_source(build_dir, build=metadata.Build()):
 | 
				
			||||||
                            count += handleproblem('DexClassLoader', path_in_build_dir, filepath)
 | 
					                            count += handleproblem('DexClassLoader', path_in_build_dir, filepath)
 | 
				
			||||||
                            break
 | 
					                            break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            elif curfile.endswith('.gradle'):
 | 
					            elif curfile.endswith('.gradle') or curfile.endswith('.gradle.kts'):
 | 
				
			||||||
                if not os.path.isfile(filepath):
 | 
					                if not os.path.isfile(filepath):
 | 
				
			||||||
                    continue
 | 
					                    continue
 | 
				
			||||||
                with open(filepath, 'r', errors='replace') as f:
 | 
					                with open(filepath, 'r', errors='replace') as f:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -50,6 +50,7 @@ class ScannerTest(unittest.TestCase):
 | 
				
			||||||
            'realm': 1,
 | 
					            'realm': 1,
 | 
				
			||||||
            'se.manyver': 2,
 | 
					            'se.manyver': 2,
 | 
				
			||||||
            'com.jens.automation2': 2,
 | 
					            'com.jens.automation2': 2,
 | 
				
			||||||
 | 
					            'com.github.shadowsocks': 5,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        for d in glob.glob(os.path.join(source_files, '*')):
 | 
					        for d in glob.glob(os.path.join(source_files, '*')):
 | 
				
			||||||
            build = fdroidserver.metadata.Build()
 | 
					            build = fdroidserver.metadata.Build()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,94 @@
 | 
				
			||||||
 | 
					import com.android.build.gradle.internal.tasks.factory.dependsOn
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					plugins {
 | 
				
			||||||
 | 
					    id("com.android.library")
 | 
				
			||||||
 | 
					    id("org.mozilla.rust-android-gradle.rust-android")
 | 
				
			||||||
 | 
					    kotlin("android")
 | 
				
			||||||
 | 
					    kotlin("kapt")
 | 
				
			||||||
 | 
					    id("kotlin-parcelize")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setupCore()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					android {
 | 
				
			||||||
 | 
					    defaultConfig {
 | 
				
			||||||
 | 
					        consumerProguardFiles("proguard-rules.pro")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        externalNativeBuild.ndkBuild {
 | 
				
			||||||
 | 
					            abiFilters("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
 | 
				
			||||||
 | 
					            arguments("-j${Runtime.getRuntime().availableProcessors()}")
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        kapt.arguments {
 | 
				
			||||||
 | 
					            arg("room.incremental", true)
 | 
				
			||||||
 | 
					            arg("room.schemaLocation", "$projectDir/schemas")
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    externalNativeBuild.ndkBuild.path("src/main/jni/Android.mk")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    sourceSets.getByName("androidTest") {
 | 
				
			||||||
 | 
					        assets.setSrcDirs(assets.srcDirs + files("$projectDir/schemas"))
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cargo {
 | 
				
			||||||
 | 
					    module = "src/main/rust/shadowsocks-rust"
 | 
				
			||||||
 | 
					    libname = "sslocal"
 | 
				
			||||||
 | 
					    targets = listOf("arm", "arm64", "x86", "x86_64")
 | 
				
			||||||
 | 
					    profile = findProperty("CARGO_PROFILE")?.toString() ?: currentFlavor
 | 
				
			||||||
 | 
					    extraCargoBuildArguments = listOf("--bin", libname!!)
 | 
				
			||||||
 | 
					    featureSpec.noDefaultBut(arrayOf(
 | 
				
			||||||
 | 
					            "stream-cipher",
 | 
				
			||||||
 | 
					            "aead-cipher-extra",
 | 
				
			||||||
 | 
					            "logging",
 | 
				
			||||||
 | 
					            "local-flow-stat",
 | 
				
			||||||
 | 
					            "local-dns"))
 | 
				
			||||||
 | 
					    exec = { spec, toolchain ->
 | 
				
			||||||
 | 
					        spec.environment("RUST_ANDROID_GRADLE_LINKER_WRAPPER_PY", "$projectDir/$module/../linker-wrapper.py")
 | 
				
			||||||
 | 
					        spec.environment("RUST_ANDROID_GRADLE_TARGET", "target/${toolchain.target}/$profile/lib$libname.so")
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					tasks.whenTaskAdded {
 | 
				
			||||||
 | 
					    when (name) {
 | 
				
			||||||
 | 
					        "mergeDebugJniLibFolders", "mergeReleaseJniLibFolders" -> dependsOn("cargoBuild")
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					tasks.register<Exec>("cargoClean") {
 | 
				
			||||||
 | 
					    executable("cargo")     // cargo.cargoCommand
 | 
				
			||||||
 | 
					    args("clean")
 | 
				
			||||||
 | 
					    workingDir("$projectDir/${cargo.module}")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					tasks.clean.dependsOn("cargoClean")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dependencies {
 | 
				
			||||||
 | 
					    val coroutinesVersion = "1.5.2"
 | 
				
			||||||
 | 
					    val roomVersion = "2.3.0"
 | 
				
			||||||
 | 
					    val workVersion = "2.7.0-beta01"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    api(project(":plugin"))
 | 
				
			||||||
 | 
					    api("androidx.core:core-ktx:1.6.0")
 | 
				
			||||||
 | 
					    // https://android-developers.googleblog.com/2019/07/android-q-beta-5-update.html
 | 
				
			||||||
 | 
					    api("androidx.drawerlayout:drawerlayout:1.1.1")
 | 
				
			||||||
 | 
					    api("androidx.fragment:fragment-ktx:1.3.6")
 | 
				
			||||||
 | 
					    api("com.google.android.material:material:1.4.0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    api("androidx.lifecycle:lifecycle-livedata-core-ktx:$lifecycleVersion")
 | 
				
			||||||
 | 
					    api("androidx.preference:preference:1.1.1")
 | 
				
			||||||
 | 
					    api("androidx.room:room-runtime:$roomVersion")
 | 
				
			||||||
 | 
					    api("androidx.work:work-multiprocess:$workVersion")
 | 
				
			||||||
 | 
					    api("androidx.work:work-runtime-ktx:$workVersion")
 | 
				
			||||||
 | 
					    api("com.google.android.gms:play-services-oss-licenses:17.0.0")
 | 
				
			||||||
 | 
					    api("com.google.code.gson:gson:2.8.8")
 | 
				
			||||||
 | 
					    api("com.google.firebase:firebase-analytics-ktx:19.0.1")
 | 
				
			||||||
 | 
					    api("com.google.firebase:firebase-crashlytics:18.2.1")
 | 
				
			||||||
 | 
					    api("com.jakewharton.timber:timber:5.0.1")
 | 
				
			||||||
 | 
					    api("dnsjava:dnsjava:3.4.1")
 | 
				
			||||||
 | 
					    api("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
 | 
				
			||||||
 | 
					    api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion")
 | 
				
			||||||
 | 
					    kapt("androidx.room:room-compiler:$roomVersion")
 | 
				
			||||||
 | 
					    androidTestImplementation("androidx.room:room-testing:$roomVersion")
 | 
				
			||||||
 | 
					    androidTestImplementation("androidx.test.ext:junit-ktx:1.1.3")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,28 @@
 | 
				
			||||||
 | 
					plugins {
 | 
				
			||||||
 | 
					    id("com.android.application")
 | 
				
			||||||
 | 
					    id("com.google.android.gms.oss-licenses-plugin")
 | 
				
			||||||
 | 
					    id("com.google.gms.google-services")
 | 
				
			||||||
 | 
					    id("com.google.firebase.crashlytics")
 | 
				
			||||||
 | 
					    kotlin("android")
 | 
				
			||||||
 | 
					    id("kotlin-parcelize")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setupApp()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					android.defaultConfig.applicationId = "com.github.shadowsocks"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dependencies {
 | 
				
			||||||
 | 
					    val cameraxVersion = "1.0.1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    implementation("androidx.browser:browser:1.3.0")
 | 
				
			||||||
 | 
					    implementation("androidx.camera:camera-camera2:$cameraxVersion")
 | 
				
			||||||
 | 
					    implementation("androidx.camera:camera-lifecycle:$cameraxVersion")
 | 
				
			||||||
 | 
					    implementation("androidx.camera:camera-view:1.0.0-alpha28")
 | 
				
			||||||
 | 
					    implementation("androidx.constraintlayout:constraintlayout:2.1.0")
 | 
				
			||||||
 | 
					    implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
 | 
				
			||||||
 | 
					    implementation("com.google.mlkit:barcode-scanning:17.0.0")
 | 
				
			||||||
 | 
					    implementation("com.google.zxing:core:3.4.1")
 | 
				
			||||||
 | 
					    implementation("com.takisoft.preferencex:preferencex-simplemenu:1.1.0")
 | 
				
			||||||
 | 
					    implementation("com.twofortyfouram:android-plugin-api-for-locale:1.0.4")
 | 
				
			||||||
 | 
					    implementation("me.zhanghai.android.fastscroll:library:1.1.7")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue