Skip to content

Commit e169513

Browse files
committed
Final API fixes
1 parent 9c84d93 commit e169513

File tree

7 files changed

+91
-52
lines changed

7 files changed

+91
-52
lines changed

Cargo.lock

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ panic = "abort"
1919
debug = true
2020

2121
[profile.release]
22-
opt-level = 's'
23-
lto = false
24-
panic = "unwind"
25-
codegen-units = 16
22+
opt-level = 3
23+
lto = true
24+
panic = "abort"
25+
codegen-units = 1
2626
debug = false
2727
debug-assertions = false
2828
overflow-checks = false

api/rust/Cargo.toml

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,52 @@
11
[package]
22
name = "azul"
3-
version = "0.0.1"
3+
version = "1.0.0-alpha1"
44
authors = ["Felix Schütt <felix.schuett@maps4print.com>"]
55
license = "MIT"
66
description = '''
7-
Azul GUI is a free, functional, immediate-mode GUI framework
8-
for rapid development of desktop applications written in Rust,
9-
supported by the Mozilla WebRender rendering engine
7+
Azul GUI is a free, functional, reactive GUI framework
8+
for rapid development of desktop applications written in Rust and C,
9+
using the Mozilla WebRender rendering engine.
1010
'''
1111
homepage = "https://azul.rs/"
1212
keywords = ["gui", "GUI", "user-interface", "svg", "graphics" ]
1313
categories = ["gui"]
14-
repository = "https://github.com/maps4print/azul"
15-
readme = "../README.md"
14+
repository = "https://github.com/fschutt/azul"
15+
readme = "../../README.md"
1616
exclude = ["../assets/*", "../doc/*", "../examples/*"]
1717
autoexamples = false
1818
edition = "2018"
1919
build = "build.rs"
2020
links = "azul"
2121

22-
[lib]
23-
path = "lib.rs"
24-
2522
[dependencies]
26-
azul-dll = { version = "0.0.1", path = "../../azul-dll", default-features = false, features = ["rlib"], optional = true }
23+
# azul-dll = { version = "0.0.1", path = "../../azul-dll", default-features = false, features = ["rlib"], optional = true }
2724

28-
[features]
29-
default = []
30-
link_static = [
31-
"azul-dll",
32-
# enable all features of azul-dll
33-
"azul-dll/std",
34-
"azul-dll/logging",
35-
"azul-dll/css_parser",
36-
"azul-dll/font_loading",
37-
"azul-dll/text_layout",
38-
"azul-dll/svg",
39-
"azul-dll/xml",
40-
"azul-dll/image_loading",
41-
"azul-dll/gif",
42-
"azul-dll/jpeg",
43-
"azul-dll/png",
44-
"azul-dll/tiff",
45-
"azul-dll/bmp",
46-
"azul-dll/ico",
47-
"azul-dll/tga",
48-
"azul-dll/hdr",
49-
"azul-dll/dxt",
50-
"azul-dll/webp",
51-
"azul-dll/pnm",
52-
]
53-
# currently blocked on gleam, allsorts, rayon and webrender not being no_std
54-
no_std = ["link_static", "azul-dll/css_parser", "azul-dll/text_layout"]
55-
minifb = ["azul-dll/std", "link_static"]
25+
# [features]
26+
# default = []
27+
# link_static = [
28+
# "azul-dll",
29+
# # enable all features of azul-dll
30+
# "azul-dll/std",
31+
# "azul-dll/logging",
32+
# "azul-dll/css_parser",
33+
# "azul-dll/font_loading",
34+
# "azul-dll/text_layout",
35+
# "azul-dll/svg",
36+
# "azul-dll/xml",
37+
# "azul-dll/image_loading",
38+
# "azul-dll/gif",
39+
# "azul-dll/jpeg",
40+
# "azul-dll/png",
41+
# "azul-dll/tiff",
42+
# "azul-dll/bmp",
43+
# "azul-dll/ico",
44+
# "azul-dll/tga",
45+
# "azul-dll/hdr",
46+
# "azul-dll/dxt",
47+
# "azul-dll/webp",
48+
# "azul-dll/pnm",
49+
# ]
50+
# # currently blocked on gleam, allsorts, rayon and webrender not being no_std
51+
# no_std = ["link_static", "azul-dll/css_parser", "azul-dll/text_layout"]
52+
# minifb = ["azul-dll/std", "link_static"]#
File renamed without changes.

azul-dll/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ panic = "unwind"
3030
debug = false
3131

3232
[profile.release]
33-
opt-level = 's'
34-
lto = false
35-
panic = "unwind"
36-
codegen-units = 16
33+
opt-level = 3
34+
lto = true
35+
panic = "abort"
36+
codegen-units = 1
3737
debug = false
3838
debug-assertions = false
3939
overflow-checks = false

build.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ def generate_api():
29872987
forward_declarations = rust_dll_result[3]
29882988

29892989
write_file(rust_dll_result[0], root_folder + "/azul-dll/src/lib.rs")
2990-
write_file(generate_rust_api(apiData, structs_map, functions_map.copy()), root_folder + "/api/rust/lib.rs")
2990+
write_file(generate_rust_api(apiData, structs_map, functions_map.copy()), root_folder + "/api/rust/src/lib.rs")
29912991
write_file(generate_c_api(apiData, structs_map), root_folder + "/api/c/azul.h")
29922992
write_file(generate_python_api(apiData, structs_map, functions_map.copy()), root_folder + "/azul-dll/src/python.rs")
29932993
write_file(generate_cpp_api(apiData, structs_map), root_folder + "/api/cpp/azul.hpp")
@@ -3629,6 +3629,7 @@ def generate_license():
36293629
license_authors = read_file(root_folder + "/LICENSE-WINDOWS.json")
36303630
license_json = json.loads(license_authors)
36313631
license_authors_formatted = format_license_authors(license_json)
3632+
remove_unused_crates(license_json, root_folder + "/../azul-v1.0-alpha1")
36323633
final_license_text = license_template.replace("$$CONTRIBUTORS_AND_LICENSES_SEE_PYTHON_SCRIPT$$", license_authors_formatted)
36333634
write_file(final_license_text, root_folder + "/LICENSE-WINDOWS.txt")
36343635
remove_path(root_folder + "/LICENSE-WINDOWS.json")
@@ -3649,6 +3650,50 @@ def format_license_authors(license_json):
36493650
license_txt += name + " v" + version + " licensed " + license + "\r\n by " + ", ".join(authors) + "\r\n"
36503651
return license_txt
36513652

3653+
# cargo vendor vendors a lot of unused crates for some reason
3654+
# this reduces the dependencies.zip file to a more reasonable size
3655+
# use WinDirState to see what files are taking up the most space
3656+
def remove_unused_crates(license_json, vendor_path):
3657+
license_txt = ""
3658+
added = [
3659+
"azul-dll",
3660+
"azul-desktop",
3661+
"azulc",
3662+
"azul-css",
3663+
"azul-core",
3664+
"azul-layout",
3665+
"azul-text-layout",
3666+
"azul-css-parser",
3667+
]
3668+
vendored_crates = os.listdir(vendor_path)
3669+
for crate in license_json:
3670+
name = crate["name"]
3671+
if not(name in added):
3672+
if name in vendored_crates:
3673+
vendored_crates.remove(name)
3674+
3675+
# vendored_crates now contains the list of vendored
3676+
# directories that are not used by this build
3677+
for folder in vendored_crates:
3678+
remove_path(vendor_path + "/" + folder)
3679+
3680+
blacklisted_folder_names = ["test", "tests", "doc", "benches", "examples", "ci", "fixtures"]
3681+
blacklisted_file_endings = [".xml", ".csv"]
3682+
3683+
# remove all "test" "tests", "doc", "benches" and "examples" "ci" directories
3684+
for v in os.listdir(vendor_path):
3685+
for f in os.listdir(vendor_path + "/" + v):
3686+
if f in blacklisted_folder_names:
3687+
remove_path(vendor_path + "/" + v + "/" + f)
3688+
3689+
# as well as any ".json", ".xml" and ".csv" files
3690+
for root, dirs, files in os.walk(vendor_path):
3691+
for file in files:
3692+
for b in blacklisted_file_endings:
3693+
if file.endswith(b):
3694+
print("removing " + os.path.join(root, file))
3695+
os.remove(os.path.join(root, file))
3696+
36523697
def full_test():
36533698
os.system('cd "' + root_folder + '/azul-dll" && cargo check --verbose --all-features')
36543699
os.system('cd "' + root_folder + '/azul-dll" && cargo check --verbose --examples')

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ name = "opengl"
3939
path = "rust/opengl.rs"
4040

4141
[dependencies]
42-
azul = { version = "0.0.1", path = "../api/rust" }
42+
azul = { version = "1.0.0-alpha1", path = "../api/rust" }
4343
# azul-widgets = { version = "0.0.2", path = "../azul-widgets" }
4444
# libc_alloc = { version = "1.0.2", default-features = false }

0 commit comments

Comments
 (0)