Skip to content

Commit

Permalink
Apply android gradle 4.2.0 plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
ab180-wontakkim committed Aug 6, 2021
1 parent 161300c commit 53a0559
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 29 deletions.
24 changes: 0 additions & 24 deletions build.gradle

This file was deleted.

40 changes: 40 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
plugins {
id("groovy")
id("maven-publish")
}

repositories {
google()
mavenCentral()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
groupId = "com.github.ab180"
artifactId = "fatjar"
version = "2.0.0"
}
}
repositories {
maven {
name = "local"
url = uri("$buildDir/maven")
}
}
}

dependencies {
implementation(gradleApi())
implementation(localGroovy())

implementation("com.android.tools.build:gradle:4.2.2")
implementation("org.zeroturnaround:zt-zip:1.13")
implementation("io.github.g00fy2:versioncompare:1.4.1")
}
2 changes: 1 addition & 1 deletion src/main/groovy/co/ab180/fatjar/FatJarProcessor.groovy
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.ab180.fatjar

import com.android.build.gradle.api.LibraryVariant
import io.github.g00fy2.versioncompare.Version
import com.tonicsystems.jarjar.Rule
import io.github.g00fy2.versioncompare.Version
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ResolvedArtifact
Expand Down
4 changes: 3 additions & 1 deletion src/main/groovy/co/ab180/fatjar/PathUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class PathUtils {
}

static String buildBundleLibRuntimeTaskPath(LibraryVariant variant, Version gradleToolVersion) {
if (gradleToolVersion.isAtLeast("4.0.0")) {
if (gradleToolVersion.isAtLeast("4.2.0")) {
return "bundleLibRuntimeToDir${variant.name.capitalize()}"
} else if (gradleToolVersion.isAtLeast("4.0.0")) {
return "bundleLibRuntimeToJar${variant.name.capitalize()}"
} else {
return "bundleLibRuntime${variant.name.capitalize()}"
Expand Down
4 changes: 1 addition & 3 deletions src/main/groovy/co/ab180/fatjar/TaskUtils.groovy
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package co.ab180.fatjar

import com.android.build.gradle.api.LibraryVariant
import io.github.g00fy2.versioncompare.Version
import com.tonicsystems.jarjar.MainProcessor
import com.tonicsystems.jarjar.Rule
import com.tonicsystems.jarjar.util.StandaloneJarProcessor
import groovy.io.FileType
import io.github.g00fy2.versioncompare.Version
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.FileTree
import org.gradle.api.tasks.bundling.Zip

import java.lang.ref.WeakReference

Expand Down

0 comments on commit 53a0559

Please sign in to comment.