Merge pull request #612 from WebFreak001/common-subpackage

Move dcd.common into separate subpackage
merged-on-behalf-of: Jan Jurzitza <gh@webfreak.org>
This commit is contained in:
The Dlang Bot 2020-05-01 13:03:04 +02:00 committed by GitHub
commit f22b193deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 16 additions and 14 deletions

7
common/dub.sdl Normal file
View File

@ -0,0 +1,7 @@
name "common"
stringImportPaths "../bin"
preGenerateCommands "rdmd \"$PACKAGE_DIR/dubhash.d\""
sourcePaths "src"
importPaths "src"
dependency "msgpack-d" version="~>1.0.0-beta.7"

View File

@ -11,13 +11,13 @@ import std.string;
void main() void main()
{ {
auto dir = environment.get("DUB_PACKAGE_DIR"); auto dir = environment.get("DUB_PACKAGE_DIR");
auto hashFile = dir.buildPath("bin", "dubhash.txt"); auto hashFile = dir.buildPath("..", "bin", "dubhash.txt");
auto gitVer = executeShell("git -C " ~ dir ~ " describe --tags"); auto gitVer = executeShell("git -C " ~ dir ~ " describe --tags");
auto ver = (gitVer.status == 0 ? gitVer.output.strip auto ver = (gitVer.status == 0 ? gitVer.output.strip
: "v" ~ dir.dirName.baseName.findSplitAfter( : "v" ~ dir.dirName.baseName.findSplitAfter(
environment.get("DUB_ROOT_PACKAGE") ~ "-")[1]).ifThrown("0.0.0") environment.get("DUB_ROOT_PACKAGE") ~ "-")[1]).ifThrown("0.0.0")
.chain(newline).to!string.strip; .chain(newline).to!string.strip;
dir.buildPath("bin").mkdirRecurse; dir.buildPath("..", "bin").mkdirRecurse;
if (!hashFile.exists || ver != hashFile.readText.strip) if (!hashFile.exists || ver != hashFile.readText.strip)
hashFile.write(ver); hashFile.write(ver);
} }

View File

@ -206,7 +206,7 @@ immutable ConstantCompletion[] traits = [
string part3 = "];"; string part3 = "];";
auto file = File("../src/dcd/common/constants2.d", "w"); auto file = File("../common/src/dcd/common/constants2.d", "w");
file.writeln(part1); file.writeln(part1);
foreach (pragma_; pragmas.sorted) foreach (pragma_; pragmas.sorted)
file.writeln('\t', pragma_, ","); file.writeln('\t', pragma_, ",");

View File

@ -9,13 +9,11 @@
"dependencies": { "dependencies": {
"dsymbol": "~>0.9.0", "dsymbol": "~>0.9.0",
"libdparse": "~>0.13.0", "libdparse": "~>0.13.0",
"msgpack-d": "~>1.0.0-beta.7", ":common": "*",
"stdx-allocator": "~>2.77.5", "stdx-allocator": "~>2.77.5",
"emsi_containers": "~>0.8.0-alpha.15" "emsi_containers": "~>0.8.0-alpha.15"
}, },
"stringImportPaths" : [ "subPackages": ["common"],
"bin"
],
"versions": ["built_with_dub"], "versions": ["built_with_dub"],
"configurations": [ "configurations": [
{ {
@ -29,7 +27,7 @@
{ {
"name": "client", "name": "client",
"targetType": "executable", "targetType": "executable",
"targetPath": "bin/", "targetPath": "bin/",
"targetName": "dcd-client", "targetName": "dcd-client",
"excludedSourceFiles": [ "excludedSourceFiles": [
"src/dcd/server/*" "src/dcd/server/*"
@ -38,14 +36,11 @@
{ {
"name": "server", "name": "server",
"targetType": "executable", "targetType": "executable",
"targetPath": "bin/", "targetPath": "bin/",
"targetName": "dcd-server", "targetName": "dcd-server",
"excludedSourceFiles": [ "excludedSourceFiles": [
"src/dcd/client/*" "src/dcd/client/*"
] ]
} }
],
"preGenerateCommands" : [
"rdmd \"$PACKAGE_DIR/dubhash.d\""
] ]
} }

View File

@ -31,7 +31,7 @@ clean:
rm -f *.o rm -f *.o
CLIENT_SRC := \ CLIENT_SRC := \
$(shell find src/dcd/common -name "*.d")\ $(shell find common/src/dcd/common -name "*.d")\
$(shell find src/dcd/client -name "*.d")\ $(shell find src/dcd/client -name "*.d")\
$(shell find msgpack-d/src/ -name "*.d") $(shell find msgpack-d/src/ -name "*.d")
@ -62,7 +62,7 @@ override LDC_CLIENT_FLAGS += $(DFLAGS)
override GDC_CLIENT_FLAGS += $(DFLAGS) override GDC_CLIENT_FLAGS += $(DFLAGS)
SERVER_SRC := \ SERVER_SRC := \
$(shell find src/dcd/common -name "*.d")\ $(shell find common/src/dcd/common -name "*.d")\
$(shell find src/dcd/server -name "*.d")\ $(shell find src/dcd/server -name "*.d")\
$(shell find ${DSYMBOL_DIR}/src -name "*.d")\ $(shell find ${DSYMBOL_DIR}/src -name "*.d")\
$(shell find ${STDXALLOC_DIR}/source -name "*.d")\ $(shell find ${STDXALLOC_DIR}/source -name "*.d")\