Skip to content

Commit

Permalink
Optimise Maven Publishing and Gradle files (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar Žigis authored Jan 2, 2024
1 parent a4b077c commit 3d15feb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 38 deletions.
10 changes: 6 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
id "com.android.application"
id 'org.jetbrains.kotlin.android'
}

android {

Expand Down Expand Up @@ -32,8 +34,8 @@ android {
targetCompatibility JavaVersion.VERSION_17
}

kotlin {
jvmToolchain(17)
kotlinOptions {
jvmTarget = '17'
}
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.9.20"
ext.kotlin_version = "1.9.21"
repositories {
google()
mavenCentral()
Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand All @@ -15,7 +15,8 @@ org.gradle.jvmargs=-Xmx2048m
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
23 changes: 1 addition & 22 deletions maven/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.java.srcDirs
from android.sourceSets.main.kotlin.srcDirs
} else {
from sourceSets.main.java.srcDirs
from sourceSets.main.kotlin.srcDirs
}
}

artifacts {
archives androidSourcesJar
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId "com.bio-matic"
artifactId PUBLISH_ARTIFACT_ID
version sdkVersion
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}

artifact androidSourcesJar

pom {
name = PUBLISH_ARTIFACT_ID
Expand Down
11 changes: 6 additions & 5 deletions segmentedarcview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id "com.android.application"
id 'org.jetbrains.kotlin.android'
}

ext {
PUBLISH_ARTIFACT_ID = "segmentedarcview"
Expand Down Expand Up @@ -32,14 +34,13 @@ android {
targetCompatibility JavaVersion.VERSION_17
}

kotlin {
jvmToolchain(17)
kotlinOptions {
jvmTarget = '17'
}

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rootProject.name = "SegmentedArcView"
include ':segmentedarcview'
include ':app'
rootProject.name = "SegmentedArcView"
include ':app'

0 comments on commit 3d15feb

Please sign in to comment.