1 /**
2 	Types for project descriptions (dub describe).
3 
4 	Copyright: © 2015 rejectedsoftware e.K.
5 	License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
6 	Authors: Sönke Ludwig
7 */
8 module dub.description;
9 
10 import dub.compilers.buildsettings;
11 import dub.dependency;
12 import dub.internal.vibecompat.data.serialization;
13 
14 
15 /**
16 	Describes a complete project for use in IDEs or build tools.
17 
18 	The build settings will be specific to the compiler, platform
19 	and configuration that has been selected.
20 */
21 struct ProjectDescription {
22 	string rootPackage;
23 	alias mainPackage = rootPackage; /// Compatibility alias
24 	string configuration;
25 	string buildType;
26 	string compiler;
27 	string[] architecture;
28 	string[] platform;
29 	PackageDescription[] packages; /// All packages in the dependency tree
30 	TargetDescription[] targets; /// Build targets
31 	@ignore TargetDescription[string] targetLookup; /// Targets by name
32 }
33 
34 
35 /**
36 	Build settings and meta data of a single package.
37 */
38 struct PackageDescription {
39 	string path;
40 	string name;
41 	Version version_;
42 	string description;
43 	string homepage;
44 	string[] authors;
45 	string copyright;
46 	string license;
47 	string[] dependencies;
48 
49 	@byName TargetType targetType;
50 	string targetPath;
51 	string targetName;
52 	string targetFileName;
53 	string workingDirectory;
54 	string mainSourceFile;
55 	string[] dflags;
56 	string[] lflags;
57 	string[] libs;
58 	string[] copyFiles;
59 	string[] versions;
60 	string[] debugVersions;
61 	string[] importPaths;
62 	string[] stringImportPaths;
63 	string[] preGenerateCommands;
64 	string[] postGenerateCommands;
65 	string[] preBuildCommands;
66 	string[] postBuildCommands;
67 	@byName BuildRequirement[] buildRequirements;
68 	@byName BuildOption[] options;
69 	SourceFileDescription[] files;
70 }
71 
72 struct TargetDescription {
73 	string rootPackage;
74 	string[] packages;
75 	string rootConfiguration;
76 	BuildSettings buildSettings;
77 	string[] dependencies;
78 	string[] linkDependencies;
79 }
80 
81 /**
82 	Description for a single source file.
83 */
84 struct SourceFileDescription {
85 	@byName SourceFileRole role;
86 	alias type = role; /// Compatibility alias
87 	string path;
88 }
89 
90 /**
91 	Determines 
92 */
93 enum SourceFileRole {
94 	unusedStringImport,
95 	unusedImport,
96 	unusedSource,
97 	stringImport,
98 	import_,
99 	source
100 }