Skip to content

Commit fcb554a

Browse files
committed
Rename gradle plugin and further planning
1 parent 1c42961 commit fcb554a

File tree

7 files changed

+17
-20
lines changed

7 files changed

+17
-20
lines changed

app/src/processing/app/gradle/GradleService.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ import kotlin.io.path.writeText
2929
// TODO: Add background building
3030
// TODO: Track build speed (for analytics?)
3131

32-
// The gradle service runs the gradle tasks and manages the gradle connection
33-
// It will create the necessary build files for gradle to run
34-
// Then it will kick off a new GradleJob to run the tasks
35-
// GradleJob manages the gradle build and connects the debugger
32+
/*
33+
* The gradle service runs the gradle tasks and manages the gradle connection
34+
* It will create the necessary build files for gradle to run
35+
* Then it will kick off a new GradleJob to run the tasks
36+
* GradleJob manages the gradle build and connects the debugger
37+
*/
3638
class GradleService(
3739
val mode: Mode,
3840
val editor: Editor?,
@@ -92,7 +94,7 @@ class GradleService(
9294
val file = workingDir.resolve("unsaved/${code.fileName}")
9395
file.parent.toFile().mkdirs()
9496
// If tab is marked modified save it to the working directory
95-
// Otherwise delete the file
97+
// Otherwise delete the file so we don't compile with old code
9698
if(code.isModified){
9799
file.writeText(code.documentText)
98100
}else{
@@ -101,10 +103,8 @@ class GradleService(
101103
return@map code.fileName
102104
}
103105

104-
val group = System.getProperty("processing.group", "org.processing")
105-
106106
val variables = mapOf(
107-
"group" to group,
107+
"group" to System.getProperty("processing.group", "org.processing"),
108108
"version" to Base.getVersionName(),
109109
"sketchFolder" to sketch.folder.absolutePath,
110110
"sketchbook" to Base.getSketchbookFolder(),
@@ -169,14 +169,14 @@ class GradleService(
169169
//
170170
""".trimIndent()
171171

172-
// TODO: add instructions keys
173172
val instructions = Language.text("gradle.instructions")
174173
.split("\n")
175174
.joinToString("\n") { "// $it" }
176175

177176
val configuration = """
177+
178178
plugins{
179-
id("org.processing.gradle") version "${Base.getVersionName()}"
179+
id("org.processing.java") version "${Base.getVersionName()}"
180180
}
181181
""".trimIndent()
182182
val content = "${header}\n${instructions}\n${configuration}"

build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ plugins {
66
alias(libs.plugins.jetbrainsCompose) apply false
77
}
88

9-
//allprojects{
10-
// repositories{
11-
// maven { url = uri("https://repo.gradle.org/gradle/libs-releases") }
12-
// }
13-
//}
14-
159
// Set the build directory to not /build to prevent accidental deletion through the clean action
1610
// Can be deleted after the migration to Gradle is complete
1711
layout.buildDirectory = file(".build")

build/shared/lib/languages/PDE.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ debugger.name = Name
319319
debugger.value = Value
320320
debugger.type = Type
321321

322+
# Gradle
323+
gradle.instructions = About this file: \nProcessing creates this file when you run your sketch. \nIt configures the tools needed to build and export your code. \nLearn more: [Gradle Primer link]\n \nTo customize this file: \n1. Delete the line above that begins with '@processing-auto-generated'. \nThis will prevent Processing from overwriting this file in the future. \n2. Make your desired changes.
324+
322325
# ---------------------------------------
323326
# Toolbars
324327

java/gradle/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies{
2222
gradlePlugin{
2323
plugins{
2424
create("processing"){
25-
id = "org.processing.gradle"
25+
id = "org.processing.java"
2626
implementationClass = "org.processing.java.gradle.ProcessingPlugin"
2727
}
2828
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
plugins{
2-
id("org.processing.gradle")
2+
id("org.processing.java")
33
}

java/gradle/src/main/kotlin/ProcessingPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ProcessingPlugin @Inject constructor(private val objectFactory: ObjectFact
2727
val workingDir = project.findProperty("processing.workingDir") as String?
2828
val debugPort = project.findProperty("processing.debugPort") as String?
2929

30-
// TODO: Setup sketchbook when using as a standalone plugin
30+
// TODO: Setup sketchbook when using as a standalone plugin, use the Java Preferences
3131
val sketchbook = project.findProperty("processing.sketchbook") as String?
3232

3333
// Apply the Java plugin to the Project

java/gradle/src/test/kotlin/ProcessingPluginTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ProcessingPluginTest{
1111
@Test
1212
fun testPluginAddsSketchTask(){
1313
val project = ProjectBuilder.builder().build()
14-
project.pluginManager.apply("org.processing.gradle")
14+
project.pluginManager.apply("org.processing.java")
1515

1616
assert(project.tasks.getByName("sketch") is Task)
1717
}

0 commit comments

Comments
 (0)