Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourceDir is not accessible when using Kotlin Script #29

Closed
ftomassetti opened this issue May 17, 2023 · 1 comment · Fixed by #34
Closed

sourceDir is not accessible when using Kotlin Script #29

ftomassetti opened this issue May 17, 2023 · 1 comment · Fixed by #34
Labels
enhancement New feature or request

Comments

@ftomassetti
Copy link

tasks.named<CompileSass>("CompileSass") {
    loadPath(project.file("${projectDir}/src/main/resources/coderdocs/assets/scss"))
    sourceDir.set(sassSources)
    outputDir = project.file("${projectDir}/src/main/resources/coderdocs-dist/assets/css")
}

Line 119: sourceDir.set(sassSources)
^ Cannot access 'sourceDir': it is private in 'CompileSass'

@EtienneMiret
Copy link
Owner

There is a setter available:

tasks.named<CompileSass>("compileSass") {
  setSourceDir(project.file("src/main/style"))
}

I will add a getter though, because of this Kotlin caveat:

Note that, if the Java class only has a setter, it isn't visible as a property in Kotlin because Kotlin doesn't support set-only properties.

@EtienneMiret EtienneMiret added the enhancement New feature or request label Jun 30, 2023
EtienneMiret added a commit that referenced this issue Jun 30, 2023
It is labeled as an @InputDirectory because it is one, although the
getInputFiles() method already list all input files.

Also, an @InputDirectory must exist, which is why we create one for
the multi project test.
@EtienneMiret EtienneMiret linked a pull request Jun 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants