forked from milkytracker/MilkyTracker
-
Notifications
You must be signed in to change notification settings - Fork 2
/
builder
executable file
·165 lines (147 loc) · 7.21 KB
/
builder
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/bash
set -e
UPSTREAM_MILKYTRACKER_COMMIT=caa8169
error(){
echo "\nERROR: $*" ; exit 1;
}
runverbose(){ set -x; "$@"; set +x; };
expecterror(){ set +e; "$@"; set +e; }
diffwork(){
set +e
find patch/src -type f | while read f; do
diff -NauEZb --brief $f ${f/patch/milkytracker} | grep -q differ && {
echo $f
diff -NauEZb $f ${f/patch/milkytracker}
test "$1" == "--copy" && cp ${f/patch/milkytracker} $f;
}
done
test -z $1 && { echo "add '--copy' to actually copy to patch-dir (or use VERBOSE= ./builder diffwork for more info)"; }
}
pull(){
echo "\nPULL: pulling+merging branches from coderofsalvation-repo"
test -d milkytracker && { echo "please remove (backup) milkytracker directory"; exit 1; }
git clone https://github.com/milkytracker/MilkyTracker milkytracker
cd milkytracker;
git remote | grep coderofsalvation || {
git remote add coderofsalvation https://github.com/coderofsalvation/milkytracker
git remote add coderofsalvation_ssh [email protected]:/coderofsalvation/milkytracker
}
git fetch coderofsalvation
test -f CMakeLists.txt && git reset $UPSTREAM_MILKYTRACKER_COMMIT --hard
git config --local user.email "[email protected]"
git config --local user.name "ci-appveyor"
git checkout master
git reset $UPSTREAM_MILKYTRACKER_COMMIT --hard
# copy this for creating diffpatch later
test -d ../milkytracker.mainline && rm -rf ../milkytracker.mainline
git submodule update --init --recursive
cp -r ../milkytracker ../milkytracker.mainline
cd ..
}
merge(){
accept_both_commits(){
for i in $*; do
cp $i /tmp/cur && awk '!/^(<<<<|====|>>>>)/ {print $0}' /tmp/cur > $i
done
git add $* && git commit -m "resolve conflict $* (accept both commits)"
}
cd milkytracker
#runverbose git merge --no-edit coderofsalvation/feat/keep-open-filedialog
runverbose git merge --no-edit coderofsalvation/bugfix/machinegun
runverbose git merge --no-edit coderofsalvation/bugfix/sustain-keyjazz-note-instead-of-retriggering
runverbose git merge --no-edit coderofsalvation/feat/sample-editor-scaling-compress
runverbose git merge --no-edit coderofsalvation/chore/copy-paste-sample-respect-relative-notenumber
runverbose git merge --no-edit coderofsalvation/chore/remove-hardcoded-envelope-color
runverbose git merge --no-edit coderofsalvation/claytone/adding-shortcuts-and-highlight-scope
runverbose git merge --no-edit coderofsalvation/feat/channelmeters-for-mixing
runverbose git merge --no-edit coderofsalvation/feat/linux-midi-specify-port
runverbose git merge --no-edit coderofsalvation/feat/masteringlimiter
runverbose git merge --no-edit coderofsalvation/feat/milky-navigation-shortcuts
runverbose git merge --no-edit coderofsalvation/feat/nonaccelerated-compatibility-mode
runverbose git merge --no-edit coderofsalvation/feat/responsive-filedialog
expecterror runverbose git merge --no-edit coderofsalvation/feat/sampleditor-scripting
accept_both_commits src/tracker/SampleEditor.cpp src/tracker/SampleEditorControl.cpp src/tracker/FilterParameters.h
sed -i 's|char \*stringPart;||g' src/tracker/FilterParameters.h
runverbose git merge --no-edit coderofsalvation/feat/sampleeditor-improved-pasting
expecterror runverbose git merge --no-edit coderofsalvation/feat/sample-editor-easy-fade-fold
accept_both_commits src/tracker/SampleEditorControl.cpp src/tracker/SampleEditor.cpp
runverbose git merge --no-edit coderofsalvation/feat/ASCIISTEP16-compatibility-stepsequencer-mode
runverbose git merge --no-edit coderofsalvation/feat/update-docs-with-asciistep16-and-scripting
rm src/tracker/FilterParameters.h
expecterror runverbose git merge --no-edit coderofsalvation/feat/milkysynth
accept_both_commits src/tracker/FilterParameters.h src/tracker/SampleEditor.cpp src/tracker/SampleEditorControl.cpp
runverbose git merge --no-edit coderofsalvation/feat/show-note-backtrace-in-instrumentlistbox
git submodule update --init --recursive
cd ..
}
patch(){
create(){
#pull && merge
echo "\nPATCH: patching"
cd patch
find . -type f | while read file; do
destfile=../milkytracker/$file
test -f $destfile && rm $destfile
runverbose cp $(pwd)/$file $destfile
done
cd ..
cp -r patch/resources/music/* milkytracker/resources/music/.
# set default milkytracker keyboard layout & default colors
sed -i 's/EditModeFastTracker/EditModeMilkyTracker/g' milkytracker/src/tracker/TrackerInit.cpp
sed -i 's/EditModeFastTracker/EditModeMilkyTracker/g' milkytracker/src/tracker/TrackerSettings.cpp
# set default resolution for notebooks/netbooks etc
sed -i 's/#define DISPLAYDEVICE_WIDTH 640/#define DISPLAYDEVICE_WIDTH 1024/g' milkytracker/src/ppui/DisplayDeviceBase.h
sed -i 's/#define DISPLAYDEVICE_HEIGHT 480/#define DISPLAYDEVICE_HEIGHT 768/g' milkytracker/src/ppui/DisplayDeviceBase.h
# set default interpolation to fast sinc
sed -i 's|settingsDatabase->store("INTERPOLATION", 1);|settingsDatabase->store("INTERPOLATION", 4);|g' milkytracker/src/tracker/TrackerSettings.cpp
sed -i 's|settingsDatabase->store("HDRECORDER_INTERPOLATION", 1);|settingsDatabase->store("HDRECORDER_INTERPOLATION", 4);|g' milkytracker/src/tracker/TrackerSettings.cpp
# set secondary highlight to 2 so ASCIISTEP16 makes immediate sense
sed -i 's|settingsDatabase->store("HIGHLIGHTMODULO2", 8);|settingsDatabase->store("HIGHLIGHTMODULO2", 2);|g' milkytracker/src/tracker/TrackerSettings.cpp
# enable backtrace note by default
sed -i 's|settingsDatabase->store("INSTRUMENTBACKTRACE", 0);|settingsDatabase->store("INSTRUMENTBACKTRACE", 1);|g' milkytracker/src/tracker/TrackerSettings.cpp
# enable multichannel editing
sed -i 's|settingsDatabase->store("MULTICHN_EDIT", 0);|settingsDatabase->store("MULTICHN_EDIT", 1);|g' milkytracker/src/tracker/TrackerSettings.cpp
# enable virtual channels JAM
sed -i 's|settingsDatabase->store("VIRTUALCHANNELS", 0);|settingsDatabase->store("VIRTUALCHANNELS", 1);|g' milkytracker/src/tracker/TrackerSettings.cpp
# set default rowadd to 0
sed -i 's|settingsDatabase->store("ROWINSERTADD", 1);|settingsDatabase->store("ROWINSERTADD", 0);|g' milkytracker/src/tracker/TrackerSettings.cpp
# now create the diff file
echo creating patch/all.patch
$(which diff) -Naur -x all.patch -x build -x appveyor.yml -x .git -x milkysynth milkytracker.mainline milkytracker > patch/all.patch
echo done
#cat patch/all.patch |less
}
apply(){
pwd
set -x
$(which patch) -p0 < patch/all.patch
cd milkytracker;
test -d src/milkysynth || git submodule add https://gitlab.com/coderofsalvation/milkysynth.git src/milkysynth
git submodule update --init --recursive
cd -
}
test -z $1 && apply
test -z $1 || "$@"
}
release(){
set -e
set -x
commit=$(git rev-parse --short HEAD)
cd milkytracker
git add resources/music src appveyor.yml CMakeLists.txt && git commit -m "release $commit + 1"
expecterror git branch -D release
git branch release
git checkout release
git push coderofsalvation release -f
}
build(){
#cp CMakeLists.txt milkytracker/.
mkdir -p milkytracker/build
cd milkytracker/build
cmake .. && make clean && make && ls -la src/tracker/milkytracker
}
all(){
pull && patch && build
}
#test -z "$1" && all
test -z "$1" || "$@"