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

backport remove @InputDirectory to avoid memory leak (#561) (#640) #712

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading