From e7b696c474026adbc9152d72cdf9feadfd01b0f0 Mon Sep 17 00:00:00 2001 From: TenderIronh Date: Sat, 18 Nov 2023 11:33:14 +0800 Subject: [PATCH] miss build.gradle --- app/README.md | 11 ++++++++ app/app/build.gradle | 62 ++++++++++++++++++++++++++++++++++++++++++++ app/build.gradle | 28 ++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 app/app/build.gradle create mode 100644 app/build.gradle diff --git a/app/README.md b/app/README.md index 5080ab2..501757e 100644 --- a/app/README.md +++ b/app/README.md @@ -11,6 +11,17 @@ echo "build ok" cp openp2p.aar openp2p-sources.jar ../app/app/libs echo "copy to APP libs" +edit app/app/build.gradle +``` +signingConfigs { + release { + storeFile file('YOUR-JKS-PATH') + storePassword 'YOUR-PASSWORD' + keyAlias 'openp2p.keys' + keyPassword 'YOUR-PASSWORD' + } + } +``` cd ../app ./gradlew build diff --git a/app/app/build.gradle b/app/app/build.gradle new file mode 100644 index 0000000..8d2be38 --- /dev/null +++ b/app/app/build.gradle @@ -0,0 +1,62 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' +} + +android { + signingConfigs { + release { + storeFile file('C:\\work\\src\\openp2p-client\\app\\openp2p.jks') + storePassword 'YOUR-PASSWORD' + keyAlias 'openp2p.keys' + keyPassword 'YOUR-PASSWORD' + } + } + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "cn.openp2p" + minSdkVersion 16 + targetSdkVersion 30 + versionCode 1 + versionName "2718281828" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.release + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + viewBinding true + } +} + +dependencies { + implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"]) + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'androidx.core:core-ktx:1.3.1' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.1' + implementation 'androidx.annotation:annotation:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.1' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation files('libs\\openp2p-sources.jar') +} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..dcc228f --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,28 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + ext.kotlin_version = "1.5.21" + repositories { + google() + mavenCentral() + } + dependencies { + classpath "com.android.tools.build:gradle:4.2.1" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + + +allprojects { + repositories { + google() + mavenCentral() + jcenter() // Warning: this repository is going to shut down soon + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file