Skip to content

Commit

Permalink
Merge pull request #837 from The-Frozen-North/clean-gitignore-move-bu…
Browse files Browse the repository at this point in the history
…ild-to-build-folder

Clean gitignore move build to build folder
  • Loading branch information
b5635 authored Nov 2, 2024
2 parents 42832b7 + 084b2cf commit 6b18a5b
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 123 deletions.
81 changes: 9 additions & 72 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,89 +1,26 @@
# Ignore everything
*
# Ignore build folder
.build/
.build/*

!.gitignore
!.gitattributes
!database/.keep
.nasher/
.nasher/*

# Whitelist devserver files
!docker-compose-dev.yml
!docker-compose-dev-seed.yml
!config/common.env
!config/nwserver_dev.env
!config/nwserver_dev_seed.env
!settings.tml
!tools/
!tools/**
!templates/
!templates/**
!grafana-provisioning/
!grafana-provisioning/**
!config/common-dev.env
# Don't add real passwords to git
config/influxdb.env
config/grafana.env
grafana-provisioning/datasources/nwn.yml
# Only the file templates
!config/influxdb-template.env
!config/grafana-template.env
!grafana-provisioning/datasources/nwn.yml.template

!mod_desc.txt

# Whitelist github and spec folder
!.github
!.github/**
!spec
!spec/**
!spec_output/src/nss/.keep

# Gemfiles
!Gemfile
!Gemfile.lock

# Whitelist dummy movie file
!movies/prelude.wbm

# This file should be ignored always
settings.tml
server/settings.tml

# Whitelist the override folder but make sure these 2das never get committed
!override/
!override/**
override/env.2da
override/env_dm.2da

# Whitelist nwn base scripts folder
!nwn-base-scripts/
!nwn-base-scripts/**

# Keep this folder so install doesn't break
!install/.keep

# Whitelist sources and nasher files
!nasher.cfg
!src/
!src/**
!presets/
!presets/**

# Only keep server template file
!server/docker-compose-template.yml
!server/docker-compose-with-analytics-template.yml

# Whitelist batch and readme files
!*.bat
!*.sh
!*.md
# Whitelist only server template files
server/*
!docker-compose-template.yml
!docker-compose-with-analytics-template.yml

# Never commit these file types
*.mod
*.ncs
*.csv

# Whitelist database files
!seeded_database
!seeded_database/**


Empty file removed install/.keep
Empty file.
4 changes: 2 additions & 2 deletions nasher.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ url = ""
author = ""

[Sources]
include = "src/**/*.{nss,json}"
include = "../src/**/*.{nss,json}"

[Rules]
"*" = "src/$ext"
"*" = "../src/$ext"

[Target]
name = "mod"
Expand Down
28 changes: 24 additions & 4 deletions win_nasher_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,33 @@ echo.
echo WARNING: Continuing will rebuild the module from source, deleting all unsaved changes! Commit or stash your changes, or exit out.
@echo on

del modules /S
rd modules\TFN
rd modules
del .build\modules /S
rd .build\modules\TFN
rd .build\modules

md .build

rmdir /s /q .build\override
robocopy override .build\override

md .build\database
md .build\movies
md .build\modules

copy seeded_database\tmapsolutions.sqlite3 .build\database\tmapsolutions.sqlite3
copy seeded_database\areadistances.sqlite3 .build\database\areadistances.sqlite3
copy seeded_database\spawns.sqlite3 .build\database\spawns.sqlite3
copy seeded_database\treasures.sqlite3 .build\database\treasures.sqlite3
copy seeded_database\randspellbooks.sqlite3 .build\database\randspellbooks.sqlite3
copy seeded_database\prettify.sqlite3 .build\database\prettify.sqlite3
copy movies\prelude.wbm .build\movies\prelude.wbm
copy nasher.cfg .build\nasher.cfg

del /f TFN.mod

"%CD%/tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/nwn-base-scripts""" --no
cd .build

"%CD%/../tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/../tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/../tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/../tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/../tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/../nwn-base-scripts""" --no

del /f TFN.mod
pause
28 changes: 24 additions & 4 deletions win_nasher_install_clean.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,33 @@ echo.
echo WARNING: Continuing will rebuild the module from source, deleting all unsaved changes! Commit or stash your changes, or exit out.
@echo on

del modules /S
rd modules\TFN
rd modules
del .build\modules /S
rd .build\modules\TFN
rd .build\modules

md .build

rmdir /s /q .build\override
robocopy override .build\override

md .build\database
md .build\movies
md .build\modules

copy seeded_database\tmapsolutions.sqlite3 .build\database\tmapsolutions.sqlite3
copy seeded_database\areadistances.sqlite3 .build\database\areadistances.sqlite3
copy seeded_database\spawns.sqlite3 .build\database\spawns.sqlite3
copy seeded_database\treasures.sqlite3 .build\database\treasures.sqlite3
copy seeded_database\randspellbooks.sqlite3 .build\database\randspellbooks.sqlite3
copy seeded_database\prettify.sqlite3 .build\database\prettify.sqlite3
copy movies\prelude.wbm .build\movies\prelude.wbm
copy nasher.cfg .build\nasher.cfg

del /f TFN.mod

"%CD%/tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/nwn-base-scripts""" --no --clean
cd .build

"%CD%/../tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/../tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/../tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/../tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/../tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/../nwn-base-scripts""" --no --clean

del /f TFN.mod
pause
2 changes: 1 addition & 1 deletion win_nasher_unpack_folder.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"%CD%/tools/win/nasher/nasher.exe" unpack --file:modules/TFN --removeDeleted --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssFlags:"-l"
"%CD%/tools/win/nasher/nasher.exe" unpack --file:.build/modules/TFN --removeDeleted --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssFlags:"-l"
git rm --cached src -r
git add .
25 changes: 17 additions & 8 deletions win_run_server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ echo.
echo WARNING: Continuing will rebuild the module from source, deleting all unsaved changes! Commit or stash your changes, or exit out.
@echo on

del modules /S
rd modules\TFN
rd modules
del .build\modules /S
rd .build\modules\TFN
rd .build\modules

del /f TFN.mod
md .build

rmdir /s /q .build\override
robocopy override .build\override

rem Fetch a timestamp and commit hash from git, and append it to mod_desc.txt
rem This is more painful than it probably needed to be
Expand All @@ -32,10 +35,14 @@ set content=
for /f "delims=" %%x in ('type mod_desc.txt') do set "content=!content!%%x!LF!"
set "content=!content!Last Updated: %timestamp% (%hash%)"

"%CD%/tools/win/nasher/nasher.exe" install --clean --verbose --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/nwn-base-scripts""" --no --modDescription "!content!"

endlocal

cd .build

"%CD%/../tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/../tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/../tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/../tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/../tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/../nwn-base-scripts""" --no --modDescription "!content!"

cd ..

del /f server\config\common.env
del /f server\modules\TFN.mod
del /f server\database\spawns.sqlite3
Expand All @@ -49,7 +56,7 @@ rmdir /s /q server\override
md server\modules
md server\database
md server\config
copy modules\TFN.mod server\modules\TFN.mod
copy .build\modules\TFN.mod server\modules\TFN.mod
copy config\common.env server\config\common.env
copy settings.tml server\settings.tml
copy seeded_database\tmapsolutions.sqlite3 server\database\tmapsolutions.sqlite3
Expand All @@ -63,8 +70,10 @@ robocopy override server\override
copy server\env\env.2da server\override\env.2da
copy server\env\env_dm.2da server\override\env_dm.2da

del /f TFN.mod
del /f .build\TFN.mod

cd server
docker-compose -f docker-compose.yml down
docker-compose -f docker-compose.yml up --no-recreate -d

PAUSE
35 changes: 23 additions & 12 deletions win_run_server_dev.bat
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
del /f database\spawns.sqlite3
del /f database\treasures.sqlite3
del /f database\randspellbooks.sqlite3
del /f database\prettify.sqlite3
del /f database\tmapsolutions.sqlite3
del /f database\areadistances.sqlite3
del /f .build\database\spawns.sqlite3
del /f .build\database\treasures.sqlite3
del /f .build\database\randspellbooks.sqlite3
del /f .build\database\prettify.sqlite3
del /f .build\database\tmapsolutions.sqlite3
del /f .build\database\areadistances.sqlite3

copy seeded_database\tmapsolutions.sqlite3 database\tmapsolutions.sqlite3
copy seeded_database\areadistances.sqlite3 database\areadistances.sqlite3
copy seeded_database\spawns.sqlite3 database\spawns.sqlite3
copy seeded_database\treasures.sqlite3 database\treasures.sqlite3
copy seeded_database\randspellbooks.sqlite3 database\randspellbooks.sqlite3
copy seeded_database\prettify.sqlite3 database\prettify.sqlite3
md .build\database
md .build\config

copy seeded_database\tmapsolutions.sqlite3 .build\database\tmapsolutions.sqlite3
copy seeded_database\areadistances.sqlite3 .build\database\areadistances.sqlite3
copy seeded_database\spawns.sqlite3 .build\database\spawns.sqlite3
copy seeded_database\treasures.sqlite3 .build\database\treasures.sqlite3
copy seeded_database\randspellbooks.sqlite3 .build\database\randspellbooks.sqlite3
copy seeded_database\prettify.sqlite3 .build\database\prettify.sqlite3

del /f .build\docker-compose-dev.yml
copy docker-compose-dev.yml .build\docker-compose-dev.yml

del /f .build\config\common.env
copy config\common.env .build\config\common.env

cd .build

docker-compose -f docker-compose-dev.yml down
docker-compose -f docker-compose-dev.yml up --no-recreate -d
50 changes: 30 additions & 20 deletions win_run_server_dev_seed.bat
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
del /f database\prettify.sqlite3
del /f database\tmapsolutions.sqlite3
del /f database\areadistances.sqlite3
del /f .build\database\prettify.sqlite3
del /f .build\database\tmapsolutions.sqlite3
del /f .build\database\areadistances.sqlite3

copy seeded_database\randspellbooks.sqlite3 database\randspellbooks.sqlite3
copy seeded_database\prettify.sqlite3 database\prettify.sqlite3
copy seeded_database\areadistances.sqlite3 database\areadistances.sqlite3
copy seeded_database\tmapsolutions.sqlite3 database\tmapsolutions.sqlite3
md .build\database
md .build\config

copy seeded_database\randspellbooks.sqlite3 .build\database\randspellbooks.sqlite3
copy seeded_database\prettify.sqlite3 .build\database\prettify.sqlite3
copy seeded_database\areadistances.sqlite3 .build\database\areadistances.sqlite3
copy seeded_database\tmapsolutions.sqlite3 .build\database\tmapsolutions.sqlite3

del /f .build\docker-compose-dev-seed.yml
copy docker-compose-dev-seed.yml .build\docker-compose-dev-seed.yml

del /f .build\config\common.env
copy config\common.env .build\config\common.env

cd .build

docker-compose -f docker-compose-dev-seed.yml down
docker-compose -f docker-compose-dev-seed.yml up --no-recreate

del /f seeded_database\spawns.sqlite3
del /f seeded_database\treasures.sqlite3
del /f seeded_database\randspellbooks.sqlite3
del /f seeded_database\prettify.sqlite3
del /f seeded_database\tmapsolutions.sqlite3
del /f seeded_database\areadistances.sqlite3

copy database\tmapsolutions.sqlite3 seeded_database\tmapsolutions.sqlite3
copy database\spawns.sqlite3 seeded_database\spawns.sqlite3
copy database\treasures.sqlite3 seeded_database\treasures.sqlite3
copy database\randspellbooks.sqlite3 seeded_database\randspellbooks.sqlite3
copy database\prettify.sqlite3 seeded_database\prettify.sqlite3
copy database\areadistances.sqlite3 seeded_database\areadistances.sqlite3
del /f ..\seeded_database\spawns.sqlite3
del /f ..\seeded_database\treasures.sqlite3
del /f ..\seeded_database\randspellbooks.sqlite3
del /f ..\seeded_database\prettify.sqlite3
del /f ..\seeded_database\tmapsolutions.sqlite3
del /f ..\seeded_database\areadistances.sqlite3

copy database\tmapsolutions.sqlite3 ..\seeded_database\tmapsolutions.sqlite3
copy database\spawns.sqlite3 ..\seeded_database\spawns.sqlite3
copy database\treasures.sqlite3 ..\seeded_database\treasures.sqlite3
copy database\randspellbooks.sqlite3 ..\seeded_database\randspellbooks.sqlite3
copy database\prettify.sqlite3 ..\seeded_database\prettify.sqlite3
copy database\areadistances.sqlite3 ..\seeded_database\areadistances.sqlite3
3 changes: 3 additions & 0 deletions win_toolset.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@echo off

md .build
cd .build

set DefaultSteamPath=C:\Program Files (x86)\Steam\steamapps\common\Neverwinter Nights\bin\win32\nwtoolset.exe
if exist "%DefaultSteamPath%" (
echo DefaultSteamPath found: "%DefaultSteamPath%"
Expand Down

0 comments on commit 6b18a5b

Please sign in to comment.