diff --git a/MANIFEST.in b/MANIFEST.in index 9d3a7a36..ecb611c2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -765,6 +765,9 @@ include tests/source-files/org.tasks/build.gradle include tests/source-files/org.tasks/build.gradle.kts include tests/source-files/org.tasks/buildSrc/build.gradle.kts include tests/source-files/org.tasks/settings.gradle.kts +include tests/source-files/org.noise_planet.noisecapture/app/build.gradle +include tests/source-files/org.noise_planet.noisecapture/settings.gradle +include tests/source-files/org.noise_planet.noisecapture/sosfilter/build.gradle include tests/source-files/osmandapp/osmand/build.gradle include tests/source-files/osmandapp/osmand/gradle/wrapper/gradle-wrapper.properties include tests/source-files/realm/react-native/android/build.gradle diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 93893c1c..87a64749 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -105,7 +105,7 @@ VALID_APPLICATION_ID_REGEX = re.compile(r'''(?:^[a-z_]+(?:\d*[a-zA-Z_]*)*)(?:\.[ ANDROID_PLUGIN_REGEX = re.compile(r'''\s*(:?apply plugin:|id)\(?\s*['"](android|com\.android\.application)['"]\s*\)?''') SETTINGS_GRADLE_REGEX = re.compile(r'settings\.gradle(?:\.kts)?') -GRADLE_SUBPROJECT_REGEX = re.compile(r'''['"]:([^'"]+)['"]''') +GRADLE_SUBPROJECT_REGEX = re.compile(r'''['"]:?([^'"]+)['"]''') MAX_VERSION_CODE = 0x7fffffff # Java's Integer.MAX_VALUE (2147483647) diff --git a/tests/common.TestCase b/tests/common.TestCase index ca733398..37f50219 100755 --- a/tests/common.TestCase +++ b/tests/common.TestCase @@ -1310,6 +1310,7 @@ class CommonTest(unittest.TestCase): 'com.anpmech.launcher': 'app', 'org.tasks': 'app', 'ut.ewh.audiometrytest': 'app', + 'org.noise_planet.noisecapture': 'app', } for k, v in subdirs.items(): build_dir = Path('source-files') / k diff --git a/tests/source-files/org.noise_planet.noisecapture/app/build.gradle b/tests/source-files/org.noise_planet.noisecapture/app/build.gradle new file mode 100644 index 00000000..158712bd --- /dev/null +++ b/tests/source-files/org.noise_planet.noisecapture/app/build.gradle @@ -0,0 +1,116 @@ +apply plugin: 'com.android.application' + +def getCheckedOutGitCommitHash() { + 'git rev-parse --verify --short HEAD'.execute().text.trim() +} + +def getAvailableLocales() { + new File("app/src/main/res").list(new FilenameFilter() { + @Override + boolean accept(File dir, String name) { + return name.startsWith("values-") && new File(new File(dir,name), "strings.xml").exists(); + } + }).collect() { fold -> fold.substring("values-".length())}.join(",") +} + +android { + compileSdkVersion 30 + buildToolsVersion '30.0.0' + def signingFilePath = System.getProperty("user.home") + "/.idea/signing.gradle" + if (new File(signingFilePath).exists()) { + apply from: signingFilePath + } + defaultConfig { + applicationId "org.noise_planet.noisecapture" + minSdkVersion 15 + targetSdkVersion 30 + versionCode 55 + versionName "1.2.19" + // Store build date in apk + buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" + buildConfigField "String", "GITHASH", "\"${getCheckedOutGitCommitHash().toString()}\"" + buildConfigField "String", "SUPPORTEDLOCALES", "\"${getAvailableLocales()}\"" + // Enabling multidex support. + multiDexEnabled false + + vectorDrawables.useSupportLibrary = true + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + dexOptions { + javaMaxHeapSize "4g" + } + lintOptions { + abortOnError false + disable 'MissingTranslation' + } + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + if (new File(signingFilePath).exists()) { + signingConfig signingConfigs.release + } + } + debug { + debuggable true + if (new File(signingFilePath).exists()) { + signingConfig signingConfigs.debug + } + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + testOptions { + unitTests { + includeAndroidResources = true + } + } +} + +// For using the MPAndroidChart package +// https://github.com/PhilJay/MPAndroidChart +// Apache License, Version 2.0 +task listrepos { + doLast { + println "Repositories:" + project.repositories.each { println "Name: " + it.name + "; url: " + it.url } + } +} + +repositories { + mavenLocal() +} + +dependencies { + implementation 'com.github.PhilJay:MPAndroidChart:v2.2.5' + implementation 'org.slf4j:slf4j-simple:1.7.12' + implementation name: 'org/noise-planet/jwarble/0.2.3/jwarble-0.2.3' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.10' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.10' + + // multithreaded FFT for realtime visualisation of spectrum only + implementation 'com.github.wendykierp:JTransforms:3.1' + implementation 'org.apache.commons:commons-math3:3.5' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.vectordrawable:vectordrawable:1.0.0' + implementation 'com.nhaarman.supertooltips:library:3.0.0' + //compile 'com.android.support:multidex:1.0.0' + // Testing-only dependencies + // Force usage of support annotations in the test app, since it is internally used by the runner module. + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + androidTestImplementation 'androidx.annotation:annotation:1.0.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test:rules:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' + // unit test + testImplementation group: 'org.robolectric', name: 'robolectric', version: '4.3.1' + testImplementation 'junit:junit:4.12' + testImplementation group: 'com.googlecode.soundlibs', name: 'jorbis', version: '0.0.17.4' + implementation project(':sosfilter') +} + diff --git a/tests/source-files/org.noise_planet.noisecapture/settings.gradle b/tests/source-files/org.noise_planet.noisecapture/settings.gradle new file mode 100644 index 00000000..3af2006a --- /dev/null +++ b/tests/source-files/org.noise_planet.noisecapture/settings.gradle @@ -0,0 +1 @@ +include 'sosfilter', 'app' diff --git a/tests/source-files/org.noise_planet.noisecapture/sosfilter/build.gradle b/tests/source-files/org.noise_planet.noisecapture/sosfilter/build.gradle new file mode 100644 index 00000000..ab7b0caa --- /dev/null +++ b/tests/source-files/org.noise_planet.noisecapture/sosfilter/build.gradle @@ -0,0 +1,31 @@ +apply plugin: 'java' +apply plugin: 'idea' +apply plugin: 'java' + +group = 'org.orbisgis' +version = '1.0-SNAPSHOT' + + +description = """Signal processing, A-weighting and third-octave bands filtering""" + +compileJava { + sourceCompatibility = 1.7 + targetCompatibility = 1.7 +} +repositories { + mavenCentral() +} + +dependencies { + compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.12' + compile group: 'com.github.wendykierp', name: 'JTransforms', version:'3.1' + testCompile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.12' + testCompile group: 'junit', name: 'junit', version:'4.12' +} + +// Copy resource for unit tests +task copyTestResources(type: Copy) { + from "${projectDir}/src/test/resources" + into "${buildDir}/classes/test" +} +processTestResources.dependsOn copyTestResources