Skip to content

Commit 074b820

Browse files
committed
Use cargo workspace
This also does some general build system cleanup.
1 parent 35a0650 commit 074b820

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Cargo.lock
2+
target
3+
14
xi-modal-input/Cargo.lock
25
xi-modal-input/target
36

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[workspace]
2+
members = [
3+
"xi-modal-input",
4+
"xi-ffi",
5+
"playground-utils",
6+
"playground-utils-ffi",
7+
]

RustPlayground/RustPlayground.xcodeproj/project.pbxproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
/* Begin PBXBuildFile section */
1010
60096082227F81E4001BE755 /* SharePreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60096081227F81E4001BE755 /* SharePreferencesViewController.swift */; };
1111
60096085227FA93E001BE755 /* Github.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60096084227FA93E001BE755 /* Github.swift */; };
12+
6009608A22837CD9001BE755 /* libplayground.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6009608922837CD9001BE755 /* libplayground.a */; };
13+
6009608C22837CF4001BE755 /* libximodal.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6009608B22837CF3001BE755 /* libximodal.a */; };
1214
6018ED18225FB15600B5DF38 /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6018ED17225FB15600B5DF38 /* Style.swift */; };
13-
603B05992272068F00FBD7FC /* libximodal.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 603B05982272068F00FBD7FC /* libximodal.a */; };
14-
603B059B227206C200FBD7FC /* libplayground.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 603B059A227206C200FBD7FC /* libplayground.a */; };
1515
603B059C2272413700FBD7FC /* libximodal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 609A225F22404CF900A3F007 /* libximodal.a */; };
1616
604B0F6022405C88007038E6 /* XiCoreProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 604B0F5F22405C88007038E6 /* XiCoreProxy.swift */; };
1717
604C7ACC226E572C00F6B277 /* playground.h in Headers */ = {isa = PBXBuildFile; fileRef = 604C7ACB226E572C00F6B277 /* playground.h */; };
@@ -67,7 +67,7 @@
6767
dstPath = "";
6868
dstSubfolderSpec = 16;
6969
files = (
70-
603B05992272068F00FBD7FC /* libximodal.a in CopyFiles */,
70+
6009608C22837CF4001BE755 /* libximodal.a in CopyFiles */,
7171
);
7272
runOnlyForDeploymentPostprocessing = 0;
7373
};
@@ -77,7 +77,7 @@
7777
dstPath = "";
7878
dstSubfolderSpec = 16;
7979
files = (
80-
603B059B227206C200FBD7FC /* libplayground.a in CopyFiles */,
80+
6009608A22837CD9001BE755 /* libplayground.a in CopyFiles */,
8181
);
8282
runOnlyForDeploymentPostprocessing = 0;
8383
};
@@ -86,10 +86,10 @@
8686
/* Begin PBXFileReference section */
8787
60096081227F81E4001BE755 /* SharePreferencesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharePreferencesViewController.swift; sourceTree = "<group>"; };
8888
60096084227FA93E001BE755 /* Github.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Github.swift; sourceTree = "<group>"; };
89+
6009608922837CD9001BE755 /* libplayground.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplayground.a; path = ../target/libplayground.a; sourceTree = "<group>"; };
90+
6009608B22837CF3001BE755 /* libximodal.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libximodal.a; path = ../target/libximodal.a; sourceTree = "<group>"; };
8991
6018ED17225FB15600B5DF38 /* Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Style.swift; path = RustPlayground/Style.swift; sourceTree = SOURCE_ROOT; };
9092
603608D2224EC693002CEAC6 /* xicore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xicore.h; path = "../xi-ffi/xicore.h"; sourceTree = "<group>"; };
91-
603B05982272068F00FBD7FC /* libximodal.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libximodal.a; path = "../xi-ffi/target/libximodal.a"; sourceTree = "<group>"; };
92-
603B059A227206C200FBD7FC /* libplayground.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplayground.a; path = "../playground-utils-ffi/target/libplayground.a"; sourceTree = "<group>"; };
9393
604B0F5F22405C88007038E6 /* XiCoreProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XiCoreProxy.swift; sourceTree = "<group>"; };
9494
604C7AC7226E56DC00F6B277 /* libplayground.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libplayground.a; sourceTree = BUILT_PRODUCTS_DIR; };
9595
604C7ACB226E572C00F6B277 /* playground.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = playground.h; path = "../playground-utils-ffi/playground.h"; sourceTree = "<group>"; };
@@ -166,11 +166,11 @@
166166
606644DE223FFED7006215A0 = {
167167
isa = PBXGroup;
168168
children = (
169+
6009608B22837CF3001BE755 /* libximodal.a */,
170+
6009608922837CD9001BE755 /* libplayground.a */,
169171
606644E9223FFED7006215A0 /* RustPlayground */,
170172
606644FC223FFED9006215A0 /* ModalInputTestTests */,
171173
606644E8223FFED7006215A0 /* Products */,
172-
603B05982272068F00FBD7FC /* libximodal.a */,
173-
603B059A227206C200FBD7FC /* libplayground.a */,
174174
609A2269224052B000A3F007 /* ModalInputTest-Bridging-Header.h */,
175175
604C7ACB226E572C00F6B277 /* playground.h */,
176176
609A22662240504100A3F007 /* libximodal.h */,
@@ -415,7 +415,7 @@
415415
);
416416
runOnlyForDeploymentPostprocessing = 0;
417417
shellPath = /bin/sh;
418-
shellScript = "# When building from Xcode we want to ensure that `cargo` is in PATH.\n# as a convenience, add the default cargo install location\nexport PATH=\"$PATH:${HOME}/.cargo/bin\"\n\nset -e\n\nif [[ $CONFIGURATION = \"Debug\" ]]; then\nRUST_CONFIGURATION=\"debug\"\nRUST_CONFIGURATION_FLAG=\"\"\nelse\nRUST_CONFIGURATION=\"release\"\nRUST_CONFIGURATION_FLAG=\"--release\"\nfi\n\nCRATE_ROOT=\"${SRCROOT}/../playground-utils-ffi\"\nOUTDIR=\"$CRATE_ROOT/target/\"\nPRODUCT_NAME=\"libplayground.a\"\n\ncd \"${CRATE_ROOT}\"\n\necho \"building ${CRATE_ROOT}, conf ${RUST_CONFIGURATION}, action ${ACTION}\"\n\nif [[ ${ACTION:-build} = \"build\" || $ACTION = \"install\" ]]; then\ncargo build $RUST_CONFIGURATION_FLAG\ncp \"${OUTDIR}/${RUST_CONFIGURATION}/${PRODUCT_NAME}\" \"${OUTDIR}/${PRODUCT_NAME}\"\nfi\n\nset +e\n";
418+
shellScript = "# When building from Xcode we want to ensure that `cargo` is in PATH.\n# as a convenience, add the default cargo install location\nexport PATH=\"$PATH:${HOME}/.cargo/bin\"\n\nset -e\n\nif [[ $CONFIGURATION = \"Debug\" ]]; then\nRUST_CONFIGURATION=\"debug\"\nRUST_CONFIGURATION_FLAG=\"\"\nelse\nRUST_CONFIGURATION=\"release\"\nRUST_CONFIGURATION_FLAG=\"--release\"\nfi\n\nCRATE_ROOT=\"${SRCROOT}/../playground-utils-ffi\"\nOUTDIR=\"${SRCROOT}/../target/\"\nPRODUCT_NAME=\"libplayground.a\"\n\ncd \"${CRATE_ROOT}\"\n\necho \"building ${CRATE_ROOT}, conf ${RUST_CONFIGURATION}, action ${ACTION}\"\n\nif [[ ${ACTION:-build} = \"build\" || $ACTION = \"install\" ]]; then\ncargo build $RUST_CONFIGURATION_FLAG\ncp \"${OUTDIR}/${RUST_CONFIGURATION}/${PRODUCT_NAME}\" \"${OUTDIR}/${PRODUCT_NAME}\"\nfi\n\nset +e\n";
419419
};
420420
609A226322404D0D00A3F007 /* ShellScript */ = {
421421
isa = PBXShellScriptBuildPhase;
@@ -432,7 +432,7 @@
432432
);
433433
runOnlyForDeploymentPostprocessing = 0;
434434
shellPath = /bin/sh;
435-
shellScript = "# When building from Xcode we want to ensure that `cargo` is in PATH.\n# as a convenience, add the default cargo install location\nexport PATH=\"$PATH:${HOME}/.cargo/bin\"\n\nset -e\n\nif [[ $CONFIGURATION = \"Debug\" ]]; then\nRUST_CONFIGURATION=\"debug\"\nRUST_CONFIGURATION_FLAG=\"\"\nelse\nRUST_CONFIGURATION=\"release\"\nRUST_CONFIGURATION_FLAG=\"--release\"\nfi\n\nCRATE_ROOT=\"${SRCROOT}/../xi-ffi\"\nOUTDIR=\"$CRATE_ROOT/target/\"\nPRODUCT_NAME=\"libximodal.a\"\n\ncd \"${CRATE_ROOT}\"\n\necho \"building ${CRATE_ROOT}, conf ${RUST_CONFIGURATION}, action ${ACTION}\"\n\nif [[ ${ACTION:-build} = \"build\" || $ACTION = \"install\" ]]; then\ncargo build $RUST_CONFIGURATION_FLAG\ncp \"${OUTDIR}/${RUST_CONFIGURATION}/${PRODUCT_NAME}\" \"${OUTDIR}/${PRODUCT_NAME}\"\nfi\n\nset +e\n";
435+
shellScript = "# When building from Xcode we want to ensure that `cargo` is in PATH.\n# as a convenience, add the default cargo install location\nexport PATH=\"$PATH:${HOME}/.cargo/bin\"\n\nset -e\n\nif [[ $CONFIGURATION = \"Debug\" ]]; then\nRUST_CONFIGURATION=\"debug\"\nRUST_CONFIGURATION_FLAG=\"\"\nelse\nRUST_CONFIGURATION=\"release\"\nRUST_CONFIGURATION_FLAG=\"--release\"\nfi\n\nCRATE_ROOT=\"${SRCROOT}/../xi-ffi\"\nOUTDIR=\"${SRCROOT}/../target/\"\nPRODUCT_NAME=\"libximodal.a\"\n\ncd \"${CRATE_ROOT}\"\n\necho \"building ${CRATE_ROOT}, conf ${RUST_CONFIGURATION}, action ${ACTION}\"\n\nif [[ ${ACTION:-build} = \"build\" || $ACTION = \"install\" ]]; then\ncargo build $RUST_CONFIGURATION_FLAG\ncp \"${OUTDIR}/${RUST_CONFIGURATION}/${PRODUCT_NAME}\" \"${OUTDIR}/${PRODUCT_NAME}\"\nfi\n\nset +e\n";
436436
};
437437
/* End PBXShellScriptBuildPhase section */
438438

0 commit comments

Comments
 (0)