Repo created
This commit is contained in:
parent
6e9a0d01ce
commit
7ee9806fba
2415 changed files with 312708 additions and 2 deletions
67
webserver/build.gradle
Normal file
67
webserver/build.gradle
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
import com.android.build.gradle.internal.tasks.LibraryJniLibsTask
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
ndkVersion '25.2.9519653'
|
||||
namespace 'org.adaway.webserver'
|
||||
|
||||
defaultConfig {
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
prefab = true
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
path 'jni/Android.mk'
|
||||
}
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
skipProject = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.android.ndk.thirdparty:openssl:1.1.1q-beta-1'
|
||||
}
|
||||
|
||||
/**
|
||||
* Task to rename executables from hello_world to libhello_world_exec.so
|
||||
* If they look like libraries, they are packaged in the apk and deployed on the device in the lib folder!
|
||||
*
|
||||
* Help with files: https://docs.gradle.org/current/userguide/working_with_files.html
|
||||
*/
|
||||
def renameJniLibAsExecutable = tasks.register('renameJniLibAsExecutable', Copy) {
|
||||
def flavor = gradle.startParameter.taskRequests.toString().containsIgnoreCase("debug") ? "debug" : "release"
|
||||
def buildFolder = file("${buildDir}/intermediates/ndkBuild/${flavor}/obj/local/")
|
||||
|
||||
dependsOn ":${project.name}:externalNativeBuild${flavor.substring(0, 1).toUpperCase()}${flavor.substring(1)}"
|
||||
|
||||
from(buildFolder) {
|
||||
exclude "**/objs"
|
||||
exclude "**/objs-debug"
|
||||
exclude "**/*.a"
|
||||
exclude "**/*.d"
|
||||
exclude "**/*.o"
|
||||
exclude "**/*.so"
|
||||
exclude "**/*.txt"
|
||||
}
|
||||
|
||||
into buildFolder
|
||||
|
||||
rename '(.+)', 'lib$1_exec.so'
|
||||
|
||||
eachFile {
|
||||
println "Replacing ${it.getPath()} from ${flavor} ndkBuild directory"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(LibraryJniLibsTask).configureEach {
|
||||
dependsOn renameJniLibAsExecutable
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue