GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #25 from FlatSpike/fix-agp-8.8.0 · deepmedia/Grease@60ddc9a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • grease/src/main/kotlin/io/deepmedia/tools/grease
    • GreasePlugin.kt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt‎

Copy file name to clipboardExpand all lines: grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
3232
import org.gradle.api.Plugin
3333
import org.gradle.api.Project
3434
import org.gradle.api.artifacts.Configuration
35+
import org.gradle.api.file.FileCollection
3536
import org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication
3637
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
3738
import org.gradle.kotlin.dsl.support.unzipTo
3839
import org.gradle.kotlin.dsl.support.zipTo
3940
import java.io.File
41+
import kotlin.reflect.full.functions
4042

4143
/**
4244
* Adds grease configurations for bundling dependencies in AAR files.
@@ -239,7 +241,15 @@ open class GreasePlugin : Plugin<Project> {
239241
}
240242
}
241243

242-
val files = projectNativeLibs.get().files().files + localJarsNativeLibs?.files.orEmpty()
244+
// In agp 8.8.0 return type of `localJarsNativeLibs` property was changed
245+
// So its starts to throw `NoSuchMethodError` when we applied older version of agp
246+
// To prevent that we simply find this function by reflection, call it
247+
// and casting result to proper type
248+
fun LibraryJniLibsTask.localJarsNativeLibs() = this::class.functions
249+
.find { it.name == "localJarsNativeLibs" }
250+
?.let { it.call() as? FileCollection }
251+
252+
val files = projectNativeLibs.get().files().files + localJarsNativeLibs()?.files.orEmpty()
243253
if (files.isNotEmpty()) {
244254
doLast { injectJniLibs() }
245255
} else {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.