Skip to content

Commit

Permalink
fix: add replacements for HillaPlugin method calls (#7150)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollovati authored Dec 30, 2024
1 parent e7d72ee commit 09e9ace
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ 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 {'
Expand All @@ -192,6 +194,8 @@ 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
Expand Down

0 comments on commit 09e9ace

Please sign in to comment.