generated from RageAgainstThePixel/upm-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 84f24e7
Showing
24 changed files
with
1,525 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# For more information about CodeOwners see: | ||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
|
||
* @StephenHodgson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: StephenHodgson | ||
patreon: RageAgainstThePixel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Bug Report | ||
|
||
## Overview | ||
<!-- A clear and concise description of what the bug is. --> | ||
|
||
## To Reproduce | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
## Expected behavior | ||
<!-- A clear and concise description of what you expected to happen. --> | ||
|
||
## Screenshots | ||
<!-- If applicable, add screenshots to help explain your problem. --> | ||
|
||
## Additional context | ||
<!-- Add any other context about the problem here. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Feature Request | ||
|
||
## Is your feature request related to a problem? Please describe. | ||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> | ||
|
||
## Describe the solution you'd like | ||
<!-- A clear and concise description of what you want to happen. --> | ||
|
||
## Describe alternatives you've considered | ||
<!-- A clear and concise description of any alternative solutions or features you've considered. --> | ||
|
||
## Additional context | ||
<!-- Add any other context or screenshots about the feature request here. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: upm-subtree-split | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
upm-subtree-split: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: upm subtree split | ||
run: | | ||
# upm subtree split | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
$packageDir = Get-Item -Path "**/Packages/com.*" | Select-Object -ExpandProperty FullName | ||
$packageDir = $packageDir.replace('${{ github.workspace }}/','') | ||
Write-Host $packageDir | ||
git subtree split --prefix="$packageDir" -b upm | ||
git checkout upm | ||
git fetch origin upm | ||
git rebase origin/upm --reapply-cherry-picks | ||
git push origin upm --force-with-lease --tags --set-upstream --verbose | ||
working-directory: ${{ github.workspace }} | ||
shell: pwsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# ============ # | ||
# System Files # | ||
# ============ # | ||
.DS_Store | ||
._* | ||
|
||
# =============== # | ||
# Unity generated # | ||
# =============== # | ||
[Aa]pp/ | ||
[Aa]pp.meta | ||
[Bb]in/ | ||
[Bb]uilds/ | ||
[Bb]uild/ | ||
[Ll]ibrary/ | ||
[Ll]ogs/ | ||
[Oo]bj/ | ||
[Tt]emp/ | ||
UserSettings/ | ||
UWP/ | ||
WindowsStoreApp/ | ||
UnityGenerated/ | ||
UnityPackageManager/ | ||
.out/ | ||
.gradle/ | ||
project.json | ||
project.lock.json | ||
*.package | ||
TextMesh Pro.meta | ||
TextMesh Pro/ | ||
UIElementsSchema/ | ||
*packages-lock.json | ||
|
||
# ============ # | ||
# Certificates # | ||
# ============ # | ||
*.cert | ||
*.privkey | ||
*.pfx | ||
*.pfx.meta | ||
|
||
# ===================================== # | ||
# Visual Studio / MonoDevelop generated # | ||
# ===================================== # | ||
.vs/ | ||
ExportedObj/ | ||
obj/ | ||
*.svd | ||
*.userprefs | ||
/*.csproj | ||
*.csproj | ||
*.pidb | ||
*.suo | ||
/*.sln | ||
*.sln | ||
*.user | ||
*.unityproj | ||
*.ipch | ||
*.opensdf | ||
*.sdf | ||
*.tlog | ||
*.log | ||
*.idb | ||
*.opendb | ||
*.vsconfig | ||
|
||
# ============================ # | ||
# Visual Studio Code Generated # | ||
# ============================ # | ||
.vscode/ | ||
|
||
# ========================= # | ||
# Jetbrains Rider Generated # | ||
# ========================= # | ||
.idea/ | ||
_ReSharper.Caches | ||
|
||
# ===================== # | ||
# Project Specific List # | ||
# ===================== # | ||
--Version/ | ||
artifacts/ | ||
StreamingAssets/ | ||
StreamingAssets.meta | ||
|
||
# ====================== # | ||
# Project Specific Links # | ||
# ====================== # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Copyright (c) Stephen Hodgson. All rights reserved. | ||
# Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
$InputAuthor = Read-Host "Set Author name: (i.e. your GitHub username)" | ||
$ProjectAuthor = "ProjectAuthor" | ||
|
||
$InputName = Read-Host "Enter a name for your new project" | ||
$ProjectName = "ProjectName" | ||
|
||
$InputScope = Read-Host "Enter a scope for your new project (optional)" | ||
|
||
if(-not [String]::IsNullOrWhiteSpace($InputScope)) { | ||
$InputScope = "$InputScope." | ||
} | ||
|
||
$ProjectScope = "ProjectScope." | ||
|
||
Write-Host "Your new com.$($InputScope.ToLower())$($InputName.ToLower()) project is being created..." | ||
Remove-Item -Path ".\Readme.md" | ||
Copy-Item -Path ".\$ProjectScope$ProjectName\Packages\com.$($ProjectScope.ToLower())$($ProjectName.ToLower())\Documentation~\Readme.md" ` | ||
-Destination ".\Readme.md" | ||
|
||
# Rename any directories before we crawl the folders | ||
Rename-Item -Path ".\$ProjectScope$ProjectName\Packages\com.$($ProjectScope.ToLower())$($ProjectName.ToLower())\Runtime\$ProjectScope$ProjectName.asmdef" ` | ||
-NewName "$InputScope$InputName.asmdef" | ||
Rename-Item -Path ".\$ProjectScope$ProjectName\Packages\com.$($ProjectScope.ToLower())$($ProjectName.ToLower())\Editor\$ProjectScope$ProjectName.Editor.asmdef" ` | ||
-NewName "$InputScope$InputName.Editor.asmdef" | ||
Rename-Item -Path ".\$ProjectScope$ProjectName\Packages\com.$($ProjectScope.ToLower())$($ProjectName.ToLower())\Tests\$ProjectScope$ProjectName.Tests.asmdef" ` | ||
-NewName "$InputScope$InputName.Tests.asmdef" | ||
Rename-Item -Path ".\$ProjectScope$ProjectName\Packages\com.$($ProjectScope.ToLower())$($ProjectName.ToLower())" ` | ||
-NewName "com.$($InputScope.ToLower())$($InputName.ToLower())" | ||
Rename-Item -Path ".\$ProjectScope$ProjectName" ` | ||
-NewName ".\$InputScope$InputName" | ||
|
||
$excludes = @('*Library*', '*Obj*','*InitializeTemplate*') | ||
Get-ChildItem -Path "*"-File -Recurse -Exclude $excludes | ForEach-Object -Process { | ||
$isValid = $true | ||
|
||
foreach ($exclude in $excludes) { | ||
if ((Split-Path -Path $_.FullName -Parent) -ilike $exclude) { | ||
$isValid = $false | ||
break | ||
} | ||
} | ||
|
||
if ($isValid) { | ||
Get-ChildItem -Path $_ -File | ForEach-Object -Process { | ||
$updated = $false; | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
# Rename all PascalCase instances | ||
if ($fileContent -cmatch $ProjectName) { | ||
$fileContent -creplace $ProjectName, $InputName | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
if ($fileContent -cmatch $ProjectScope) { | ||
$fileContent -creplace $ProjectScope, $InputScope | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
if ($fileContent -cmatch $ProjectAuthor) { | ||
$fileContent -creplace $ProjectAuthor, $InputAuthor | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
$StephenHodgson = "StephenHodgson" | ||
|
||
if ($fileContent -cmatch $StephenHodgson) { | ||
$fileContent -creplace $StephenHodgson, $InputAuthor | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
# Rename all lowercase instances | ||
if ($fileContent -cmatch $ProjectName.ToLower()) { | ||
$fileContent -creplace $ProjectName.ToLower(), $InputName.ToLower() | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
if ($fileContent -cmatch $ProjectScope.ToLower()) { | ||
$fileContent -creplace $ProjectScope.ToLower(), $InputScope.ToLower() | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
# Rename all UPPERCASE instances | ||
if ($fileContent -cmatch $ProjectName.ToUpper()) { | ||
$fileContent -creplace $ProjectName.ToUpper(), $InputName.ToUpper() | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
if ($fileContent -cmatch $ProjectScope.ToUpper()) { | ||
$fileContent -creplace $ProjectScope.ToUpper(), $InputScope.ToUpper() | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
# Update guids | ||
if ($fileContent -match "#INSERT_GUID_HERE#") { | ||
$fileContent -replace "#INSERT_GUID_HERE#", [guid]::NewGuid() | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
$fileContent = Get-Content $($_.FullName) -Raw | ||
|
||
# Update year | ||
if ($fileContent -match "#CURRENT_YEAR#") { | ||
$fileContent -replace "#CURRENT_YEAR#", (Get-Date).year | Set-Content $($_.FullName) -NoNewline | ||
$updated = $true | ||
} | ||
|
||
# Rename files | ||
if ($_.Name -match $ProjectName) { | ||
Rename-Item -LiteralPath $_.FullName -NewName ($_.Name -replace ($ProjectName, $InputName)) | ||
$updated = $true | ||
} | ||
|
||
if ($updated) { | ||
Write-Host $_.Name | ||
} | ||
} | ||
} | ||
} | ||
|
||
Remove-Item -Path "InitializeTemplate.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) #CURRENT_YEAR# ProjectAuthor | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.