-
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.
remove creation of default compile configuration and default build task
- Loading branch information
Showing
8 changed files
with
31 additions
and
120 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
53 changes: 0 additions & 53 deletions
53
src/main/kotlin/org/move/cli/runConfigurations/AptosBuildTaskRunner.kt
This file was deleted.
Oops, something went wrong.
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
53 changes: 7 additions & 46 deletions
53
src/main/kotlin/org/move/ide/newProject/ProjectInitializationSteps.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 |
---|---|---|
@@ -1,57 +1,18 @@ | ||
package org.move.ide.newProject | ||
|
||
import com.intellij.execution.RunnerAndConfigurationSettings | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.vfs.VirtualFile | ||
import org.move.cli.MvConstants | ||
import org.move.cli.runConfigurations.aptos.AptosTransactionConfigurationType | ||
import org.move.cli.runConfigurations.aptos.cmd.AptosCommandConfiguration | ||
import org.move.cli.runConfigurations.aptos.cmd.AptosCommandConfigurationFactory | ||
import org.move.ide.notifications.updateAllNotifications | ||
import org.move.openapiext.addRunConfiguration | ||
import org.move.openapiext.contentRoots | ||
import org.move.openapiext.openFile | ||
import org.move.openapiext.runManager | ||
import org.move.stdext.toPath | ||
import org.move.openapiext.openFileInEditor | ||
|
||
object ProjectInitializationSteps { | ||
fun openMoveTomlInEditor(project: Project, moveTomlFile: VirtualFile? = null) { | ||
val file = | ||
moveTomlFile ?: run { | ||
val packageRoot = project.contentRoots.firstOrNull() | ||
if (packageRoot != null) { | ||
val manifest = packageRoot.findChild(MvConstants.MANIFEST_FILE) | ||
return@run manifest | ||
} | ||
return@run null | ||
} | ||
if (file != null) { | ||
project.openFile(file) | ||
} | ||
updateAllNotifications(project) | ||
} | ||
|
||
fun createDefaultCompileConfigurationIfNotExists(project: Project) { | ||
if (project.runManager.allConfigurationsList.isEmpty()) { | ||
createDefaultCompileConfiguration(project, true) | ||
} | ||
} | ||
|
||
fun createDefaultCompileConfiguration(project: Project, selected: Boolean): RunnerAndConfigurationSettings { | ||
val runConfigurationAndWithSettings = | ||
project.addRunConfiguration(selected) { runManager, _ -> | ||
val configurationFactory = AptosTransactionConfigurationType.getInstance() | ||
.configurationFactories.find { it is AptosCommandConfigurationFactory } | ||
?: error("AnyCommandConfigurationFactory should be present in the factories list") | ||
runManager.createConfiguration("Compile Project", configurationFactory) | ||
.apply { | ||
(configuration as? AptosCommandConfiguration)?.apply { | ||
command = "move compile" | ||
workingDirectory = project.basePath?.toPath() | ||
} | ||
} | ||
} | ||
return runConfigurationAndWithSettings | ||
fun Project.guessMoveTomlFile(): VirtualFile? { | ||
val packageRoot = this.contentRoots.firstOrNull() | ||
if (packageRoot != null) { | ||
val manifest = packageRoot.findChild(MvConstants.MANIFEST_FILE) | ||
return manifest | ||
} | ||
return null | ||
} | ||
|
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