Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build.gradle - gitlab.com/quite/humla.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76b381c1cc8ca08d441ab86b1a537035764bddd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
 * Copyright (C) 2014 Andrew Comminos
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

buildscript {
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.1.4'
    }
}
apply plugin: 'com.android.library'

repositories {
    mavenCentral()
    google()
}

dependencies {
    api 'com.google.protobuf:protobuf-java:3.11.4'
    api 'com.madgag.spongycastle:core:1.51.0.0'

    // Custom PKCS12 keybag parse modifications to support Mumble unencrypted certificates
    // Source: https://github.com/Morlunk/spongycastle/tree/pkcs12-keybag-fixes
    api files('libs/humla-spongycastle/prov/build/libs/prov-1.51.0.0.jar',
              'libs/humla-spongycastle/pkix/build/libs/pkix-1.51.0.0.jar')

    implementation 'com.googlecode.javacpp:javacpp:0.7'
    implementation 'org.jetbrains:annotations:18.0.0'
    implementation 'org.minidns:minidns-hla:0.3.4'
    implementation 'org.minidns:minidns-android21:0.3.4'
    implementation 'com.google.guava:guava:28.2-android'
    testImplementation 'junit:junit:4.13.2'
}

allprojects {
    tasks.withType(JavaCompile) {
        // TODO include deprecations at some point, but currently they are *many*
        options.compilerArgs << "-Xlint:all" << "-Xlint:-deprecation" << "-Xlint:-dep-ann"
    }
}

android {
    namespace 'se.lublin.humla'

    compileSdk 34
    ndkVersion '25.1.8937393'
    //buildToolsVersion '29.0.3'

    sourceSets.main.jniLibs.srcDir 'src/main/libs/'
    sourceSets.main.jni.srcDirs = [] // Disable NDK build support until it supports multiple modules.

    // Need to enable this when defaultConfig below contains some custom BuildConfig
    buildFeatures {
        buildConfig true
    }

    defaultConfig {
        testApplicationId "se.lublin.humla.test"
        testInstrumentationRunner "android.test.InstrumentationTestRunner"
        minSdkVersion 14
        targetSdk 34

//        ndk {
//            abiFilters "armeabi", "armeabi-v7a", "x86"
//            stl "gnustl_static"
//            cFlags "-I\$(LOCAL_PATH)/speex/include/ -I\$(LOCAL_PATH)/celt-0.11.0-src/include/ -I\$(LOCAL_PATH)/celt-0.7.0-src/include/ -I\$(LOCAL_PATH)/opus/include -D__EMX__ -DUSE_KISS_FFT -DFIXED_POINT -DEXPORT='' -DHAVE_CONFIG_H -fvisibility=hidden -DOPUS_BUILD -DVAR_ARRAYS -Wno-traditional -DFIXED_POINT"
//        }
    }

    // Trigger NDK build on java compilation task.
    task ndkBuild(type: Exec) {
        def ndkExe = "$project.android.ndkDirectory/ndk-build"
        if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
          ndkExe += '.cmd'
        }
        commandLine ndkExe, '-C', file('src/main/jni/').absolutePath
    }

    tasks.withType(JavaCompile) {
        compileTask -> compileTask.dependsOn ndkBuild
    }

    lint {
        abortOnError true
        // InvalidPackage is spongycastle-related
        disable 'InvalidPackage', 'MissingTranslation'
        explainIssues true
        ignoreWarnings false
        quiet false
    }
}