-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parse aptos command line json output
- Loading branch information
Showing
7 changed files
with
122 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosCompileArgs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.move.cli.runConfigurations.aptos | ||
|
||
import org.move.cli.MoveProject | ||
import org.move.cli.externalLinter.ExternalLinter | ||
import org.move.cli.externalLinter.externalLinterSettings | ||
import org.move.cli.settings.moveSettings | ||
import java.nio.file.Path | ||
|
||
data class AptosCompileArgs( | ||
val linter: ExternalLinter, | ||
val moveProjectDirectory: Path, | ||
val extraArguments: String, | ||
val envs: Map<String, String>, | ||
val enableMove2: Boolean, | ||
val skipLatestGitDeps: Boolean, | ||
) { | ||
companion object { | ||
fun forMoveProject(moveProject: MoveProject): AptosCompileArgs { | ||
val linterSettings = moveProject.project.externalLinterSettings | ||
val moveSettings = moveProject.project.moveSettings | ||
|
||
val additionalArguments = linterSettings.additionalArguments | ||
val enviroment = linterSettings.envs | ||
val workingDirectory = moveProject.workingDirectory | ||
|
||
return AptosCompileArgs( | ||
linterSettings.tool, | ||
workingDirectory, | ||
additionalArguments, | ||
enviroment, | ||
enableMove2 = moveSettings.enableMove2, | ||
skipLatestGitDeps = moveSettings.skipFetchLatestGitDeps | ||
) | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosProcessOutput.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.move.cli.runConfigurations.aptos | ||
|
||
import com.intellij.execution.process.ProcessOutput | ||
import org.move.openapiext.RsProcessExecutionException | ||
import org.move.stdext.RsResult | ||
|
||
typealias AptosProcessResult<T> = RsResult<AptosProcessOutput<T>, RsProcessExecutionException> | ||
|
||
data class AptosProcessOutput<T>( | ||
val item: T, | ||
val output: ProcessOutput, | ||
val exitStatus: AptosExitStatus, | ||
) { | ||
fun <T, U> replaceItem(newItem: U): AptosProcessOutput<U> = AptosProcessOutput(newItem, output, exitStatus) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters