Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Restructured for Rojo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Feb 13, 2019
1 parent 59903dc commit 72e6dc3
Show file tree
Hide file tree
Showing 36 changed files with 328 additions and 76 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
imgs/*.psd
imgs/*.psd
.luacheckrc
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ As always, you can also check the commit history for a given version as well, an

| Version | Date | Description |
| ---|---|--- |
| [1.3.0](#1.3.0) | 2019-12-19 | <ul><li>Restructured source directory and installer to be compatible with Rojo</li></ul> |
| [1.2.6](#1.2.6) | 2018-11-12 | <ul><li>Expanded TableUtil library</li></ul> |
| [1.2.5](#1.2.5) | 2018-09-20 | <ul><li>Added `__aeroPreventStart` flag for modules that already implement a Start method.</li><li>Added `__aeroPreventInit` flag for modules that already implement an Init method.</li><li>Flagged `__aeroPreventStart` for CameraShaker module.</li></ul> |
| [1.2.4](#1.2.4) | 2018-09-20 | <ul><li>Using `coroutine` yielding/resuming where applicable</li><li>Cleaned up deprecated code in TaskScheduler</li></ul> |
Expand All @@ -22,6 +23,9 @@ As always, you can also check the commit history for a given version as well, an

### Version History Notes

#### <a name="1.3.0"> Version 1.3.0
Restructured source directory and installer to be compatible with Rojo. For compatibility, please be sure to update the plugin as well. The older versions of the plugin are not compatible with the new directory structure, and thus will fail to install or update the framework.

#### <a name="1.2.6"> Version 1.2.6
Expanded the TableUtil library. Specifically, the following functions have been added:

Expand Down
71 changes: 29 additions & 42 deletions build_filelist.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,41 @@
#!/usr/bin/python

# Author: Stephen Leitnick
# Date: July 22, 2017

# Date: February 12, 2019

import os
import re
import json

filelistName = "filelist.json"

prefix = "https://raw.githubusercontent.com/Sleitnick/AeroGameFramework/master/src/"
emptyDirSuffix = "EMPTY"

rootdir = os.path.join(".", "src")
data = {}
data["url"] = prefix
data["paths"] = []


def fix_path(path):
return path[len(rootdir) + 1:].replace("\\", "/")

FILELIST_NAME = "filelist.json"
FILELIST_MIN_NAME = "filelist.min.json"
FILELIST_INDENT = 2

# Get all files:
def get_all_files():
for subdir,dirs,files in os.walk(rootdir):
if (len(files) == 0 and subdir != rootdir and len(dirs) == 0):
data["paths"].append(fix_path(rootdir) + "/" + emptyDirSuffix)
for file in files:
path = fix_path(os.path.join(subdir, file))
data["paths"].append(path)
FETCH_PREFIX = "https://raw.githubusercontent.com/Sleitnick/AeroGameFramework/master/"
ROOT_DIR = os.path.join(".", "src")

def path_to_dictionary(path):
d = {
"name": os.path.basename(path),
"type": "file"
}
if os.path.isdir(path):
d["type"] = "directory"
d["children"] = [path_to_dictionary(os.path.join(path, p)) for p in os.listdir(path)]
return d

def write_to_filelist_file():

# Sort and concatenate array:
data["paths"].sort(key=len)
filelistStr = json.dumps(data, indent=4)

# Write file:
filelist = open(filelistName, "w")
filelist.write(filelistStr)
filelist.close()

def write_json_to_file(filename, json_obj, indent):
with open(filename, "w") as f:
json.dump(json_obj, f, indent=FILELIST_INDENT if indent else None)

def build():
get_all_files()
write_to_filelist_file()


build()
print "File list built"
data = {
"url": FETCH_PREFIX,
"paths": path_to_dictionary(ROOT_DIR)
}
write_json_to_file(FILELIST_NAME, data, True)
write_json_to_file(FILELIST_MIN_NAME, data, False)

if __name__ == "__main__":
print("Building file list...")
build()
print("File list built")
Loading

0 comments on commit 72e6dc3

Please sign in to comment.