forked from PatilShreyas/AndroidGPR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
92 lines (76 loc) · 2.49 KB
/
build.gradle
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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'maven-publish' // 1. Apply plugin
// 2. Declare library details
ext {
mGroupId = "com.example"
mArtifactId = "simple-library"
mVersionCode = 1
mVersionName = "0.2.0"
mLibraryName = "SimpleLibrary"
mLibraryDescription = "Simple Library for simple things!"
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode mVersionCode
versionName mVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
// 3. Declare task for creation of android sources.
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
// 4. Make configuration for publishing artifact.
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
groupId mGroupId
artifactId mArtifactId
version mVersionName
from components.release
artifact androidSourcesJar
pom {
name = mLibraryName
description = mLibraryDescription
}
}
}
// 5. Update repository details and credentials.
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/PatilShreyas/AndroidGPR")
credentials {
username = System.getenv("GPR_USER")
password = System.getenv("GPR_KEY")
}
}
}
}
}
// Assembling should be performed before publishing package
publish.dependsOn assemble