linkedin / linkedin/pygradle

ImporterCLI wrapped in a gradle task

Open
#79 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
603
Forks
142
PR merge metrics
No merged PRs in 30d

Description

I'm using this code for our internal creation of the ivy repo.
Others may find this useful.
This file is in our `buildSrc`.

```groovy
import com.linkedin.python.importer.ImporterCLI
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction

import java.util.stream.Collectors

class ImporterTask extends DefaultTask {

@OutputDirectory
File repo

@Input
Collection dependencies

@Input
Map replace

@TaskAction
def runAction() {
final List args = new ArrayList<>()
args.add("--repo")
args.add(repo.absolutePath)
args.addAll(dependencies)
if (replace != null) {
args.add("--replace")
final String replaceString = replace
.entrySet()
.stream()
.map {e -> "${e.key}=${e.value}".toString()}
.collect(Collectors.joining(","))
args.add(replaceString)
}
ImporterCLI.main(args.toArray(new String[args.size()]))
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the proposed task in buildSrc and the com.linkedin.python.importer.ImporterCLI entry point. Confirm how the Gradle task should expose the repo, dependencies, and replacement values, then verify that it invokes ImporterCLI successfully; the issue does not name tests or a more specific acceptance check.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, python
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.