-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRenameProject.bat
85 lines (70 loc) · 6.65 KB
/
RenameProject.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@echo off
echo --INSTRUCTIONS--
echo Do not use any of these characters: " ' @ $ # `, if you wish to use any of these you must do so manually after this script is done.
set /p ToolName="Enter ToolName (a-Z_): "
set /p Prefix="Enter Assembly Prefix (a-Z_.), usually Company (ex 'HBS.'): "
set /p PostFix="Enter Assembly Postfix (a-Z_.) (ex '.Kentico.MVC'): "
set /p GitHubUrl="Enter GitHub Url: "
set /p Tags="Enter NuGet Tags (space separated): "
set /p AssemblyTitle="Enter Assembly Title: "
set /p AssemblyDescription="Enter Assembly Description: "
set /p AssemblyCompany="Enter Assembly Company: "
set /p AssemblyProduct="Enter Assembly Product Name: "
set /p AssemblyCopyright="Enter Assembly Copyright: "
cd ShareableComponentBoilerplate.Views
cd Views
cd Shared
cd Widgets
powershell -Command "(gc _ShareableComponentBoilerplate.cshtml) -replace 'CompanyName.ShareableComponentBoilerplate.Kentico.MVC', '%Prefix%%ToolName%%PostFix%' | Out-File -encoding ASCII _ShareableComponentBoilerplate.cshtml"
powershell -Command "(gc _ShareableComponentBoilerplate.cshtml) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII _ShareableComponentBoilerplate.cshtml"
rename _ShareableComponentBoilerplate.cshtml _%ToolName%.cshtml
cd..
cd..
cd..
cd Properties
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyTitleHere', '%AssemblyTitle%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyDescriptionHere', '%AssemblyDescription%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyCompanyHere', '%AssemblyCompany%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyProductHere', '%AssemblyProduct%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyCopyrightHere', '%AssemblyCopyright%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace '3703e296-cd7c-47ff-9ab5-19b621c80b15', [GUID]::NewGuid() | Out-File -encoding ASCII AssemblyInfo.cs"
cd..
powershell -Command "(gc ShareableComponentBoilerplate.Views.csproj) -replace 'CompanyName.ShareableComponentBoilerplate.Kentico.MVC', '%Prefix%%ToolName%%PostFix%' | Out-File -encoding ASCII ShareableComponentBoilerplate.Views.csproj"
powershell -Command "(gc ShareableComponentBoilerplate.Views.csproj) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII ShareableComponentBoilerplate.Views.csproj"
rename ShareableComponentBoilerplate.Views.csproj %ToolName%.Views.csproj
cd..
rename ShareableComponentBoilerplate.Views %ToolName%.Views
cd ShareableComponentBoilerplate
powershell -Command "(gc BuildPackage.bat) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII BuildPackage.bat"
powershell -Command "(gc ShareableComponentBoilerplateWidget.cs) -replace 'CompanyName.ShareableComponentBoilerplate.Kentico.MVC', '%Prefix%%ToolName%%PostFix%' | Out-File -encoding ASCII ShareableComponentBoilerplateWidget.cs"
powershell -Command "(gc ShareableComponentBoilerplateWidget.cs) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII ShareableComponentBoilerplateWidget.cs"
powershell -Command "(gc ShareableComponentBoilerplateWidget.cs) -replace 'CompanyName.', '%Prefix%' | Out-File -encoding ASCII ShareableComponentBoilerplateWidget.cs"
rename ShareableComponentBoilerplateWidget.cs %ToolName%Widget.cs
powershell -Command "(gc ShareableComponentBoilerplateWidgetModel.cs) -replace 'CompanyName.ShareableComponentBoilerplate.Kentico.MVC', '%Prefix%%ToolName%%PostFix%' | Out-File -encoding ASCII ShareableComponentBoilerplateWidgetModel.cs"
powershell -Command "(gc ShareableComponentBoilerplateWidgetModel.cs) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII ShareableComponentBoilerplateWidgetModel.cs"
rename ShareableComponentBoilerplateWidgetModel.cs %ToolName%WidgetModel.cs
powershell -Command "(gc ShareableComponentBoilerplate.csproj) -replace 'CompanyName.ShareableComponentBoilerplate.Kentico.MVC', '%Prefix%%ToolName%%PostFix%' | Out-File -encoding ASCII ShareableComponentBoilerplate.csproj"
powershell -Command "(gc ShareableComponentBoilerplate.csproj) -replace 'CompanyName.', '%Prefix%' | Out-File -encoding ASCII ShareableComponentBoilerplate.csproj"
powershell -Command "(gc ShareableComponentBoilerplate.csproj) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII ShareableComponentBoilerplate.csproj"
rename ShareableComponentBoilerplate.csproj %ToolName%.csproj
powershell -Command "(gc ShareableComponentBoilerplate.nuspec) -replace 'CompanyName.ShareableComponentBoilerplate', '%Prefix%%ToolName%' | Out-File -encoding ASCII ShareableComponentBoilerplate.nuspec"
powershell -Command "(gc ShareableComponentBoilerplate.nuspec) -replace '--TagsHere--', '%Tags%' | Out-File -encoding ASCII ShareableComponentBoilerplate.nuspec"
powershell -Command "(gc ShareableComponentBoilerplate.nuspec) -replace 'http://url', '%GitHubUrl%' | Out-File -encoding ASCII ShareableComponentBoilerplate.nuspec"
powershell -Command "(gc ShareableComponentBoilerplate.nuspec) -replace '--CopyrightHere--', '%AssemblyCopyright%' | Out-File -encoding ASCII ShareableComponentBoilerplate.nuspec"
rename ShareableComponentBoilerplate.nuspec %ToolName%.nuspec
cd Properties
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyTitleHere', '%AssemblyTitle%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyDescriptionHere', '%AssemblyDescription%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyCompanyHere', '%AssemblyCompany%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyProductHere', '%AssemblyProduct%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace 'AssemblyCopyrightHere', '%AssemblyCopyright%' | Out-File -encoding ASCII AssemblyInfo.cs"
powershell -Command "(gc AssemblyInfo.cs) -replace '60d45549-bb62-4999-8f29-987b58b33127', [GUID]::NewGuid() | Out-File -encoding ASCII AssemblyInfo.cs"
cd..
cd..
rename ShareableComponentBoilerplate %ToolName%
powershell -Command "(gc ShareableComponentBoilerplate.sln) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII ShareableComponentBoilerplate.sln"
rename ShareableComponentBoilerplate.sln %ToolName%.sln
cd targets
powershell -Command "(gc Kentico.EmbeddedViews.targets) -replace 'ShareableComponentBoilerplate', '%ToolName%' | Out-File -encoding ASCII Kentico.EmbeddedViews.targets"
cd..
pause