@@ -4,22 +4,20 @@ plugins {
44 id ' maven-publish'
55}
66
7- def githubProperties = new Properties ()
8- githubProperties. load(new FileInputStream (rootProject. file(" github.properties" ))) // Set env variable GPR_USER & GPR_API_KEY if not adding a properties file
7+
98
109def getVersion = { ->
11- return " 1 .0.0" // Replace with version Name
10+ return " 0 .0.0" // Replace with version Name
1211}
1312
1413def getArtifactId = { ->
1514 return " library"
1615}
1716
18- publishing {
17+ /* publishing {
1918 publications {
2019 bar(MavenPublication) {
21- // groupId 'com.github.fmaxx.stopwatch'
22- groupId ' library'
20+ groupId 'AndroidStopwatch'
2321 artifactId getArtifactId()
2422 version getVersion()
2523 artifact("$buildDir/outputs/aar/${getArtifactId()}-release.aar")
@@ -55,32 +53,74 @@ publishing {
5553
5654 repositories {
5755 maven {
56+ def githubProperties = new Properties()
57+ githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
58+
5859 name = "GitHubPackages"
59- /* * Configure path of your package repository on Github
60- ** Replace GITHUB_USERID with your/organisation Github userID
61- ** and REPOSITORY with the repository name on GitHub
62- */
63- url = uri(" https://maven.pkg.github.com/fmaxx/androidStopwatch" )
60+ url = uri("https://maven.pkg.github.com/fmaxx/AndroidStopwatch")
6461 credentials {
65- /* * Create github.properties in root project folder file with
66- ** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
67- ** Set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
68-
6962 username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
7063 password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
7164 }
7265 }
7366 }
74- }
75-
76-
77- // shared deps
78- apply from : " $rootProject . projectDir /base.gradle"
67+ }*/
7968
8069android {
70+ compileSdk 33
8171 namespace ' com.github.fmaxx.stopwatch'
72+ defaultConfig {
73+ minSdk 21
74+ targetSdk 33
75+ versionCode 1
76+ versionName " 1.0"
77+ testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
78+ }
79+
80+ buildTypes {
81+ release {
82+ minifyEnabled false
83+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
84+ }
85+ }
86+ compileOptions {
87+ sourceCompatibility JavaVersion . VERSION_1_8
88+ targetCompatibility JavaVersion . VERSION_1_8
89+ }
90+ kotlinOptions {
91+ jvmTarget = ' 1.8'
92+ }
93+
94+ publishing {
95+ singleVariant(" release" ) {
96+ withSourcesJar()
97+ withJavadocJar()
98+ }
99+ }
100+
101+ testOptions {
102+ unitTests. all {
103+ useJUnitPlatform()
104+ }
105+ }
82106}
83107
84108dependencies {
85109 implementation(libs. lifecycleViewmodelKtx)
110+ testImplementation(libs. bundles. test)
111+ androidTestImplementation(libs. bundles. androidTest)
112+ }
113+
114+ afterEvaluate {
115+ publishing {
116+ publications {
117+ // Creates a Maven publication called "release".
118+ release(MavenPublication ) {
119+ from components. release
120+ groupId = ' AndroidStopwatch'
121+ artifactId = getArtifactId()
122+ version = getVersion()
123+ }
124+ }
125+ }
86126}
0 commit comments