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

Revert "MF-5759 fix stability of stone task output across different machines" #551

Closed
wants to merge 1 commit into from
Closed
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
Expand Up @@ -12,17 +12,13 @@ import java.io.File
import java.io.FileOutputStream
import javax.inject.Inject
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import javax.inject.Inject
import javax.inject.Inject
Suggested change
import javax.inject.Inject
import javax.inject.Inject

import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.ProjectLayout

@CacheableTask
abstract class StoneTask : DefaultTask() {

@get:Inject
abstract val exec: ExecOperations

@get:Inject
abstract val layout: ProjectLayout

@get:Input
abstract val stoneConfigs: ListProperty<StoneConfig>

Expand Down Expand Up @@ -94,13 +90,6 @@ abstract class StoneTask : DefaultTask() {
}
}

// Order of inputs can affect the output of stone
// Sorting spec files by relative path makes order stable across machines
val projectDirectory = layout.projectDirectory.asFile
val sortedSpecFiles = specFiles.sortedBy {
it.toRelativeString(projectDirectory)
}.map { it.absolutePath }.toTypedArray()

stoneConfigs.get().forEachIndexed { index, stoneConfig ->
val isFirst = index == 0
val append: Boolean = !isFirst
Expand All @@ -111,7 +100,7 @@ abstract class StoneTask : DefaultTask() {

generatorFile.get().asFile,
outputDirectory.absolutePath,
*sortedSpecFiles,
*specFiles.map { it.absolutePath }.toTypedArray(),
"--", "--package", stoneConfig.packageName,
)

Expand Down