| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "libprocessing"] | ||
| path = libprocessing | ||
| url = https://github.com/processing/libprocessing |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| plugins { | ||
| `kotlin-dsl` | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package processing.gradle | ||
|
|
||
| import org.gradle.api.DefaultTask | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.file.RegularFileProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.* | ||
| import org.gradle.process.ExecOperations | ||
| import javax.inject.Inject | ||
|
|
||
| abstract class CargoBuildTask : DefaultTask() { | ||
|
|
||
| @get:Inject | ||
| abstract val execOperations: ExecOperations | ||
|
|
||
| @get:InputDirectory | ||
| abstract val cargoWorkspaceDir: DirectoryProperty | ||
|
|
||
| @get:Input | ||
| abstract val manifestPath: Property<String> | ||
|
|
||
| @get:Input | ||
| abstract val release: Property<Boolean> | ||
|
|
||
| @get:Input | ||
| abstract val cargoPath: Property<String> | ||
|
|
||
| @get:OutputFile | ||
| abstract val outputLibrary: RegularFileProperty | ||
|
|
||
| init { | ||
| group = "rust" | ||
| description = "Builds Rust library using cargo" | ||
|
|
||
| // release by default | ||
| release.convention(true) | ||
| } | ||
|
|
||
| @TaskAction | ||
| fun build() { | ||
| val buildType = if (release.get()) "release" else "debug" | ||
| logger.lifecycle("Building Rust library ($buildType mode)...") | ||
|
|
||
| val args = mutableListOf("build") | ||
| if (release.get()) { | ||
| args.add("--release") | ||
| } | ||
| args.add("--manifest-path") | ||
| args.add(manifestPath.get()) | ||
|
|
||
| execOperations.exec { | ||
| workingDir = cargoWorkspaceDir.get().asFile | ||
| commandLine = listOf(cargoPath.get()) + args | ||
| } | ||
| } | ||
| } |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityHere as well - this reverts the changes from my other PR, #1473.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThanks for pointing this out! I'll get it reverted
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.