Skip to content

Commit

Permalink
Revert "feat: Property to disable hilla task registration (#6519)"
Browse files Browse the repository at this point in the history
This reverts commit 1c09c83.
  • Loading branch information
manolo committed Jan 3, 2025
1 parent 3fc6a5c commit cf179f4
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions scripts/generator/templates/template-vaadin-gradle-plugin-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ String oldPackage = 'package com.vaadin.hilla.gradle.plugin'
String newPackage = 'package com.vaadin.gradle.plugin'
String oldPluginClassDef = 'public class HillaPlugin : Plugin<Project> {'
String newPluginClassDef = 'public class VaadinPlugin : Plugin<Project> {'
String oldPluginCreateEngineConf = 'HillaPlugin.createEngineConfiguration'
String newPluginCreateEngineConf = 'VaadinPlugin.createEngineConfiguration'
String importDef = 'import com.vaadin.gradle.VaadinPlugin'
String projectDef = 'override fun apply(project: Project) {'
String projectTaskDef = 'project.tasks.apply {'
// Use NIO to walk through the directory
Files.walk(Paths.get(directoryPath))
Expand All @@ -194,14 +189,6 @@ Files.walk(Paths.get(directoryPath))
String updatedContent = content.replace(oldPackage, newPackage)
// Replace the old plugin class definition with the new one
updatedContent = updatedContent.replace(oldPluginClassDef, newPluginClassDef)
// Replace the old plugin method calls definition with the new one
updatedContent = updatedContent.replace(oldPluginCreateEngineConf, newPluginCreateEngineConf)
// Add import for getBooleanProperty
updatedContent = updatedContent.replace(importDef,importDef+'\nimport com.vaadin.gradle.getBooleanProperty')
// Collect hilla used property
updatedContent = updatedContent.replace(projectDef, projectDef + '\nval hillaUsed = project.getBooleanProperty("hilla.active") ?: true;')
// Do not apply tasks if hilla not used
updatedContent = updatedContent.replace(projectTaskDef,'if(hillaUsed) '+projectTaskDef)
// Write the updated content back to the file
Files.write(path, updatedContent.getBytes())
println "Updated package declaration in file: ${path}"
Expand Down

0 comments on commit cf179f4

Please sign in to comment.