-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
110 lines (89 loc) · 3.18 KB
/
build.zig
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
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const zig_archive = b.dependency("zig_archive", .{});
const archive_mod = zig_archive.module("archive");
const cyborg_module = b.addModule("cyborg", .{
.root_source_file = .{ .path = "src/main.zig" },
});
cyborg_module.addImport("archive", archive_mod);
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const run_tests = b.addRunArtifact(main_tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_tests.step);
const exe = b.addExecutable(.{
.name = "cyborg",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("archive", zig_archive.module("archive"));
b.installArtifact(exe);
const dexter_exe = b.addExecutable(.{
.name = "dexter",
.root_source_file = .{ .path = "src/dexter.zig" },
.target = target,
.optimize = optimize,
});
b.installArtifact(dexter_exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
const run_dexter_cmd = b.addRunArtifact(dexter_exe);
run_dexter_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_dexter_cmd.addArgs(args);
}
const run_dexter_step = b.step("run-dexter", "Run the app");
run_dexter_step.dependOn(&run_dexter_cmd.step);
}
pub const ApplicationOptions = struct {
api_level: []const u8,
};
pub fn addApplication() AndroidApplication {}
/// Represents an Android Application, which is a collection of components
/// that all represent different entry points
pub const AndroidApplication = struct {
components: std.ArrayListUnmanaged(),
pub const Component = union(enum) {
activity: Activity,
service: Service,
broadcast_receiver: BroadcastReceiver,
content_provider: ContentProvider,
};
/// Application entry point for providing a graphical user interface
pub const Activity = struct {
kind: ActivityKind,
pub const ActivityKind = union(enum) {
dex: std.Build.FileSource,
native: std.Build.FileSource,
};
};
/// Application entry point for long-running operations
pub const Service = struct {
dex: std.Build.FileSource,
};
/// Application entry point for responding to system events
pub const BroadcastReceiver = struct {
dex: std.Build.FileSource,
};
/// Application entry point for mapping data to URIs
pub const ContentProvider = struct {
dex: std.Build.FileSource,
};
/// Files depended on by the application - includes application icons
pub const Resource = struct {
pub const ResourceKind = union(enum) {
drawable: std.Build.FileSource,
};
};
};