Skip to content

Commit

Permalink
Fix relative file paths, update run configurations (#35)
Browse files Browse the repository at this point in the history
* add applicationKt run configuration

* workingDirectory=rootDir instead of "/" for Python script

* add gradle task that runs in example project

* remove outdated run configurations

* rename run configs

* change python script working directory from rootDir to moduleDir

* fix build: set mainClassName required by shadowJar for application plugin
  • Loading branch information
vavilovm authored Dec 19, 2022
1 parent a00a448 commit d63e6c6
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 48 deletions.
11 changes: 0 additions & 11 deletions .run/Example Exec Main.run.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .run/Example MyPy.run.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .run/Example PyLint.run.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .run/Example Test.run.xml

This file was deleted.

24 changes: 24 additions & 0 deletions .run/Example_ Run Paddle CLI (Gradle).run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example: Run Paddle CLI (Gradle)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/cli" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="run" />
<option value="--args=&quot;run$main&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example Build" type="JetRunConfigurationType">
<configuration default="false" name="Example: Run Paddle CLI (Kotlin)" type="JetRunConfigurationType">
<option name="MAIN_CLASS_NAME" value="io.paddle.ApplicationKt" />
<module name="paddle.app.main" />
<option name="PROGRAM_PARAMETERS" value="linter:pylint" />
<module name="paddle.cli.main" />
<option name="PROGRAM_PARAMETERS" value="run$main" />
<shortenClasspath name="NONE" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/example" />
<option name="WORKING_DIRECTORY" value="example" />
<method v="2">
<option name="Make" enabled="true" />
</method>
Expand Down
12 changes: 12 additions & 0 deletions cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ plugins {
id("com.github.breadmoirai.github-release") version "2.2.12" apply true
id("tanvd.kosogor") version "1.0.12" apply true
id("org.graalvm.buildtools.native") version "0.9.13"
application
}

application {
mainClass.set("io.paddle.ApplicationKt")
@Suppress("DEPRECATION")
mainClassName = "io.paddle.ApplicationKt" // required by shadowJar
tasks.run.get().workingDir = rootProject.projectDir.resolve("example")
}


dependencies {
implementation(project(":core"))
implementation(project(":plugins:python"))
Expand Down Expand Up @@ -79,3 +88,6 @@ graalvmNative {
tasks.named<BuildNativeImageTask>("nativeCompile") {
classpathJar.set(shadowJar.task.archiveFile)
}



Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class PythonScriptCommandLineStateProvider : PaddleTaskRunProfileStateProvider<R
scriptParameters = task.arguments.joinToString(" ")
sdkHome = module.pythonSdk?.homePath
isModuleMode = task.isModuleMode
workingDirectory = context.moduleDir.absolutePath
}

updateBeforeRunTasks(task, context)
Expand Down

0 comments on commit d63e6c6

Please sign in to comment.