Skip to content

Commit

Permalink
fix copythirdpartylibs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-raab committed Jul 4, 2021
1 parent 7ada053 commit e397124
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier
import java.io.File
import javax.inject.Inject

/**
Expand Down Expand Up @@ -85,8 +86,6 @@ open class CopyThirdpartyLibs @Inject constructor(
@get:Classpath
@get:IgnoreEmptyDirectories
val configurationClasspath: FileCollection by lazy {
val returnFiles = project.files()

val libs = mutableListOf<String>()

if(libFilterFile.isPresent && libFilterFile.get().asFile.exists()) {
Expand All @@ -97,6 +96,8 @@ open class CopyThirdpartyLibs @Inject constructor(
project.logger.debug("No lib filter entries available.")
}

val deplibs = mutableListOf<File>()

project.configurations.getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME)
.resolvedConfiguration.lenientConfiguration.allModuleDependencies.forEach { dependency ->
dependency.moduleArtifacts.forEach { artifact ->
Expand All @@ -105,14 +106,14 @@ open class CopyThirdpartyLibs @Inject constructor(
if(! CartridgeUtil.isCartridge(project, identifier)) {
val id = "${identifier.group}-${identifier.module}-${identifier.version}"
if(! libs.contains(id)) {
returnFiles.files.add(artifact.file)
deplibs.add(artifact.file)
}
}
}
}
}

returnFiles
project.files(deplibs)
}

init {
Expand Down

0 comments on commit e397124

Please sign in to comment.