Skip to content

Commit

Permalink
remove @InputDirectory to avoid memory leak (#561) (#640) (#712)
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Perndorfer <mpern@users.noreply.github.com>
  • Loading branch information
david0 and mpern committed Feb 15, 2024
1 parent ead8362 commit 242f54c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package pl.allegro.tech.build.axion.release.domain

import org.gradle.api.file.Directory
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional

Expand Down Expand Up @@ -38,16 +36,16 @@ abstract class RepositoryConfig extends BaseExtension {
customKey.convention(gradleProperty(CUSTOM_KEY_PROPERTY))
customKeyFile.convention(gradleProperty(CUSTOM_KEY_FILE_PROPERTY)
.map({ layout.projectDirectory.file(it) }))
directory.convention(repositoryDirectory)
directory.convention(repositoryDirectory.asFile.absolutePath)
}

@Input
@Optional
abstract Property<String> getType()

@InputDirectory
@Input
@Optional
abstract DirectoryProperty getDirectory()
abstract Property<String> getDirectory()

@Input
@Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ScmPropertiesFactory {
static ScmProperties create(VersionConfig config) {
return new ScmProperties(
config.repository.type.get(),
config.repository.directory.asFile.get(),
new File(config.repository.directory.get()),
config.repository.remote.get(),
config.repository.pushTagsOnly().get(),
config.repository.fetchTags().get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RepositoryConfigFactoryTest extends Specification {
RepositoryConfig config = Fixtures.repositoryConfig(project)

then:
config.directory.asFile.get() == project.rootDir
new File(config.directory.get()) == project.rootDir
}

def "should not initialize authorization options when no flags on project"() {
Expand Down

0 comments on commit 242f54c

Please sign in to comment.