diff --git a/Cargo.lock b/Cargo.lock index 6e428cde4..f74b2e1f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,10 +102,7 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "azul" -version = "0.0.1" -dependencies = [ - "azul-dll", -] +version = "1.0.0-alpha1" [[package]] name = "azul-core" diff --git a/Cargo.toml b/Cargo.toml index 2c3af02c0..939266e75 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,10 +19,10 @@ panic = "abort" debug = true [profile.release] -opt-level = 's' -lto = false -panic = "unwind" -codegen-units = 16 +opt-level = 3 +lto = true +panic = "abort" +codegen-units = 1 debug = false debug-assertions = false overflow-checks = false diff --git a/api/rust/Cargo.toml b/api/rust/Cargo.toml index 0b6bf070d..d8f99e9b9 100644 --- a/api/rust/Cargo.toml +++ b/api/rust/Cargo.toml @@ -1,55 +1,52 @@ [package] name = "azul" -version = "0.0.1" +version = "1.0.0-alpha1" authors = ["Felix Schütt "] license = "MIT" description = ''' - Azul GUI is a free, functional, immediate-mode GUI framework - for rapid development of desktop applications written in Rust, - supported by the Mozilla WebRender rendering engine + Azul GUI is a free, functional, reactive GUI framework + for rapid development of desktop applications written in Rust and C, + using the Mozilla WebRender rendering engine. ''' homepage = "https://azul.rs/" keywords = ["gui", "GUI", "user-interface", "svg", "graphics" ] categories = ["gui"] -repository = "https://github.com/maps4print/azul" -readme = "../README.md" +repository = "https://github.com/fschutt/azul" +readme = "../../README.md" exclude = ["../assets/*", "../doc/*", "../examples/*"] autoexamples = false edition = "2018" build = "build.rs" links = "azul" -[lib] -path = "lib.rs" - [dependencies] -azul-dll = { version = "0.0.1", path = "../../azul-dll", default-features = false, features = ["rlib"], optional = true } +# azul-dll = { version = "0.0.1", path = "../../azul-dll", default-features = false, features = ["rlib"], optional = true } -[features] -default = [] -link_static = [ - "azul-dll", - # enable all features of azul-dll - "azul-dll/std", - "azul-dll/logging", - "azul-dll/css_parser", - "azul-dll/font_loading", - "azul-dll/text_layout", - "azul-dll/svg", - "azul-dll/xml", - "azul-dll/image_loading", - "azul-dll/gif", - "azul-dll/jpeg", - "azul-dll/png", - "azul-dll/tiff", - "azul-dll/bmp", - "azul-dll/ico", - "azul-dll/tga", - "azul-dll/hdr", - "azul-dll/dxt", - "azul-dll/webp", - "azul-dll/pnm", -] -# currently blocked on gleam, allsorts, rayon and webrender not being no_std -no_std = ["link_static", "azul-dll/css_parser", "azul-dll/text_layout"] -minifb = ["azul-dll/std", "link_static"] \ No newline at end of file +# [features] +# default = [] +# link_static = [ +# "azul-dll", +# # enable all features of azul-dll +# "azul-dll/std", +# "azul-dll/logging", +# "azul-dll/css_parser", +# "azul-dll/font_loading", +# "azul-dll/text_layout", +# "azul-dll/svg", +# "azul-dll/xml", +# "azul-dll/image_loading", +# "azul-dll/gif", +# "azul-dll/jpeg", +# "azul-dll/png", +# "azul-dll/tiff", +# "azul-dll/bmp", +# "azul-dll/ico", +# "azul-dll/tga", +# "azul-dll/hdr", +# "azul-dll/dxt", +# "azul-dll/webp", +# "azul-dll/pnm", +# ] +# # currently blocked on gleam, allsorts, rayon and webrender not being no_std +# no_std = ["link_static", "azul-dll/css_parser", "azul-dll/text_layout"] +# minifb = ["azul-dll/std", "link_static"]# \ No newline at end of file diff --git a/api/rust/lib.rs b/api/rust/src/lib.rs similarity index 100% rename from api/rust/lib.rs rename to api/rust/src/lib.rs diff --git a/azul-dll/Cargo.toml b/azul-dll/Cargo.toml index 7d62e359e..1bfe073b7 100644 --- a/azul-dll/Cargo.toml +++ b/azul-dll/Cargo.toml @@ -30,10 +30,10 @@ panic = "unwind" debug = false [profile.release] -opt-level = 's' -lto = false -panic = "unwind" -codegen-units = 16 +opt-level = 3 +lto = true +panic = "abort" +codegen-units = 1 debug = false debug-assertions = false overflow-checks = false diff --git a/build.py b/build.py index e4a444678..3b9dd5301 100644 --- a/build.py +++ b/build.py @@ -2987,7 +2987,7 @@ def generate_api(): forward_declarations = rust_dll_result[3] write_file(rust_dll_result[0], root_folder + "/azul-dll/src/lib.rs") - write_file(generate_rust_api(apiData, structs_map, functions_map.copy()), root_folder + "/api/rust/lib.rs") + write_file(generate_rust_api(apiData, structs_map, functions_map.copy()), root_folder + "/api/rust/src/lib.rs") write_file(generate_c_api(apiData, structs_map), root_folder + "/api/c/azul.h") write_file(generate_python_api(apiData, structs_map, functions_map.copy()), root_folder + "/azul-dll/src/python.rs") write_file(generate_cpp_api(apiData, structs_map), root_folder + "/api/cpp/azul.hpp") @@ -3629,6 +3629,7 @@ def generate_license(): license_authors = read_file(root_folder + "/LICENSE-WINDOWS.json") license_json = json.loads(license_authors) license_authors_formatted = format_license_authors(license_json) + remove_unused_crates(license_json, root_folder + "/../azul-v1.0-alpha1") final_license_text = license_template.replace("$$CONTRIBUTORS_AND_LICENSES_SEE_PYTHON_SCRIPT$$", license_authors_formatted) write_file(final_license_text, root_folder + "/LICENSE-WINDOWS.txt") remove_path(root_folder + "/LICENSE-WINDOWS.json") @@ -3649,6 +3650,50 @@ def format_license_authors(license_json): license_txt += name + " v" + version + " licensed " + license + "\r\n by " + ", ".join(authors) + "\r\n" return license_txt +# cargo vendor vendors a lot of unused crates for some reason +# this reduces the dependencies.zip file to a more reasonable size +# use WinDirState to see what files are taking up the most space +def remove_unused_crates(license_json, vendor_path): + license_txt = "" + added = [ + "azul-dll", + "azul-desktop", + "azulc", + "azul-css", + "azul-core", + "azul-layout", + "azul-text-layout", + "azul-css-parser", + ] + vendored_crates = os.listdir(vendor_path) + for crate in license_json: + name = crate["name"] + if not(name in added): + if name in vendored_crates: + vendored_crates.remove(name) + + # vendored_crates now contains the list of vendored + # directories that are not used by this build + for folder in vendored_crates: + remove_path(vendor_path + "/" + folder) + + blacklisted_folder_names = ["test", "tests", "doc", "benches", "examples", "ci", "fixtures"] + blacklisted_file_endings = [".xml", ".csv"] + + # remove all "test" "tests", "doc", "benches" and "examples" "ci" directories + for v in os.listdir(vendor_path): + for f in os.listdir(vendor_path + "/" + v): + if f in blacklisted_folder_names: + remove_path(vendor_path + "/" + v + "/" + f) + + # as well as any ".json", ".xml" and ".csv" files + for root, dirs, files in os.walk(vendor_path): + for file in files: + for b in blacklisted_file_endings: + if file.endswith(b): + print("removing " + os.path.join(root, file)) + os.remove(os.path.join(root, file)) + def full_test(): os.system('cd "' + root_folder + '/azul-dll" && cargo check --verbose --all-features') os.system('cd "' + root_folder + '/azul-dll" && cargo check --verbose --examples') diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 59573c893..74ba107aa 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -39,6 +39,6 @@ name = "opengl" path = "rust/opengl.rs" [dependencies] -azul = { version = "0.0.1", path = "../api/rust" } +azul = { version = "1.0.0-alpha1", path = "../api/rust" } # azul-widgets = { version = "0.0.2", path = "../azul-widgets" } # libc_alloc = { version = "1.0.2", default-features = false }