https://kotlinlang.org logo
Title
x

xenoterracide

05/08/2018, 11:33 PM
have this code in gradle
val sourcesJar by tasks.creating(Jar::class) {
     classifier = "sources"
     from(java.sourceSets["main"].allSource)
     }
trying to convert this code to java from kotlin for a plugin, but I'm not sure I understand the from
@Override
    public void apply( Project project ) {
        if (  System.getenv("JRS_S3_URI") != null ) {
            project.getTasks().create( "sources", Jar.class, task -> {
                List<SourceDirectorySet> collect
                        = getSourceSets().stream().map( SourceSet::getAllSource ).forEach( task::include );
                task.include( collect );
            } );
        }
    }
is the not compiling that I've come up with so far
a

araqnid

05/09/2018, 1:46 PM
sourceSets is a property of the "java" convention object of the project (type is javaConvention or sth)