Skip to content

Commit

Permalink
update maven
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeXeon committed Dec 7, 2021
1 parent cd31541 commit 1d94b42
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 11 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:4.1.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
}
ext {
groupId = 'open.source.iconfont'
}
}

allprojects {
Expand All @@ -25,4 +27,6 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}


7 changes: 3 additions & 4 deletions iconfont-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'open.source.iconfont.assets'

android {
compileSdkVersion 30
Expand Down
19 changes: 17 additions & 2 deletions iconfont-assets/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'
apply plugin: 'maven'
version = '1.0.0'
group = 'open.source.iconfont'
apply plugin: 'maven-publish'
def NAME = 'iconfont-assets'
def VERSION = '1.0'

java {
sourceCompatibility = JavaVersion.VERSION_1_7
Expand All @@ -14,3 +15,17 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
}

afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
from components.java
groupId = rootProject.ext.groupId
artifactId = NAME
version = VERSION
}
}
}
}

This file was deleted.

34 changes: 32 additions & 2 deletions iconfont/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
}

def NAME = 'iconfont'
def VERSION = '1.0'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
Expand Down Expand Up @@ -33,10 +37,36 @@ android {
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
}


afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release

// You can then customize attributes of the publication as shown below.
groupId = rootProject.ext.groupId
artifactId = NAME
version = VERSION
}
// Creates a Maven publication called “debug”.
debug(MavenPublication) {
// Applies the component for the debug build variant.
from components.debug

groupId = rootProject.ext.groupId
artifactId = NAME + '-debug'
version = VERSION
}
}
}
}

0 comments on commit 1d94b42

Please sign in to comment.