-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed problem with placing carts in SMP
- Loading branch information
Vswe
authored and
Philip Hansen
committed
Jun 22, 2014
1 parent
05c8b6c
commit 7782d8b
Showing
9 changed files
with
123 additions
and
8 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
Binary file not shown.
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,115 @@ | ||
import zipfile | ||
import glob, os | ||
import sys | ||
import re | ||
import shutil | ||
|
||
changelog = '[' | ||
first = True | ||
isDev = False | ||
isSecret = False | ||
while True: | ||
change = input("Add an updated feature: ") | ||
if change == "done": | ||
break | ||
elif change == "secret": | ||
isSecret = True; | ||
break | ||
elif change == "dev": | ||
isDev = True; | ||
break | ||
elif change == "exit": | ||
sys.exit(1) | ||
else: | ||
if not first: | ||
changelog += ',' | ||
changelog += '"' + change + '"' | ||
first = False | ||
changelog += ']' | ||
|
||
|
||
targetfolder = "../../public/" | ||
if not isDev: | ||
max_version = 0 | ||
for name in glob.glob(targetfolder + "StevesCarts2.0.0.b*.zip"): | ||
shortname = os.path.basename(name) | ||
version = shortname[18:-4] | ||
try: | ||
version=int(version) | ||
except: | ||
continue | ||
max_version = max(max_version, version) | ||
max_version += 1 | ||
beta = str(max_version) | ||
version_string = "2.0.0.b" + beta; | ||
else: | ||
version_string = "2.0.0.dev"; | ||
|
||
|
||
|
||
|
||
#set version | ||
gen_path = "src/main/java/vswe/stevescarts/Helpers/GeneratedInfo.java"; | ||
|
||
info = open(gen_path, "r") | ||
content = info.read() | ||
info.close() | ||
|
||
content = re.sub('/\*@v\*/"2\.0\.0\.((dev)|(b[0-9]+[a-z]?))";', '/*@v*/"' + version_string + '";', content) | ||
|
||
if isDev: | ||
inDevStr = "true" | ||
else: | ||
inDevStr = "false" | ||
|
||
content = re.sub('/\*@d\*/(true|false);', '/*@d*/' + inDevStr + ';', content) | ||
|
||
info = open(gen_path, "w") | ||
info.write(content) | ||
info.close() | ||
#end set version | ||
|
||
#set version gradle | ||
gradle_path = "build.gradle"; | ||
|
||
info = open(gradle_path, "r") | ||
content = info.read() | ||
info.close() | ||
|
||
content = re.sub('\nversion = ".*?"', '\nversion = "' + version_string + '"', content) | ||
|
||
info = open(gradle_path, "w") | ||
info.write(content) | ||
info.close() | ||
#end set version gradle | ||
|
||
|
||
|
||
os.system("build.LNK") | ||
|
||
|
||
src = "build/libs/StevesCarts-" + version_string + ".jar" | ||
target = targetfolder + "StevesCarts" + version_string + ".jar" | ||
|
||
|
||
shutil.copyfile(src, target) | ||
|
||
|
||
if not isDev: | ||
download_path = targetfolder + "DownloadInfo.js"; | ||
info = open(download_path, "r") | ||
content = info.read() | ||
info.close() | ||
|
||
prefix = '' | ||
if isSecret: | ||
prefix = '//' | ||
|
||
content = re.sub('//@Expand', '//@Expand\n' + prefix + 'addVersionB("' + beta + '", ' + changelog + ');', content) | ||
|
||
info = open(download_path, "w") | ||
info.write(content) | ||
info.close() | ||
|
||
|
||
|
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
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
Empty file.
File renamed without changes.
File renamed without changes.