Skip to content

Commit a2e840c

Browse files
Merge pull request #11 from andre2007/feature_settings_json
Settings view added
2 parents cd26e18 + c40c835 commit a2e840c

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed

source/dubregistry/web.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,10 @@ class DubRegistryFullWebFrontend {
6161
auto commands = getCommands();
6262
render!("docs.commandline.dt", commands);
6363
}
64+
65+
@path("/settings")
66+
void getSettings()
67+
{
68+
render!("settings.dt");
69+
}
6470
}

views/layout.inc.menu.dt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- import std.range : empty;
1111
- import std.string : split;
1212
- import std.typecons : tuple;
13-
- auto listitems = [tuple("Packages", ["https://code.dlang.org"]), tuple("Documentation", ["Getting Started;getting_started", "Advanced Usage;advanced_usage", "Command line documentation;commandline", "Development;develop", "Package format (JSON);package-format-json", "Package format (SDLang);package-format-sdl"]), tuple("About", ["Forums;http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub", "Bug tracker (website);https://github.com/dlang/dub-registry/issues", "Bug tracker (DUB);https://github.com/dlang/dub/issues", "Github repository (website);https://github.com/dlang/dub-registry", "GitHub repository (DUB);https://github.com/dlang/dub"]), tuple("Download", ["https://code.dlang.org/download"])];
13+
- auto listitems = [tuple("Packages", ["https://code.dlang.org"]), tuple("Documentation", ["Getting Started;getting_started", "Advanced Usage;advanced_usage", "Command line documentation;commandline", "Development;develop", "Package format (JSON);package-format-json", "Package format (SDLang);package-format-sdl", "Settings;settings"]), tuple("About", ["Forums;http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub", "Bug tracker (website);https://github.com/dlang/dub-registry/issues", "Bug tracker (DUB);https://github.com/dlang/dub/issues", "Github repository (website);https://github.com/dlang/dub-registry", "GitHub repository (DUB);https://github.com/dlang/dub"]), tuple("Download", ["https://code.dlang.org/download"])];
1414
ul
1515
- foreach(items; listitems)
1616
- if(items[1].length < 2)

views/settings.dt

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
extends layout
2+
3+
block title
4+
- auto title = "Settings";
5+
6+
block body
7+
h2 Configuring default settings
8+
9+
p User/System wide default DUB values can be specified in settings.json file.
10+
11+
p A settings.json file could look like this:
12+
13+
pre.code
14+
|{
15+
| "defaultArchitecture": "x86_64",
16+
| "defaultCompiler": "ldc"
17+
|}
18+
19+
p The file settings.json can be located in different locations. Last item in list has highest priority.
20+
21+
p Windows
22+
ul
23+
li <code>%ProgramData%\dub\settings.json</code>
24+
li <code>&lt;dub executable folder&gt;\..\etc\dub\settings.json</code>
25+
li <code>%APPDATA%\dub\settings.json</code>
26+
27+
p Posix
28+
ul
29+
li <code>/var/lib/dub/settings.json</code>
30+
li <code>&lt;dub executable folder&gt;/../etc/dub/settings.json</code>
31+
li <code>~/.dub/settings.json</code>
32+
33+
h3 Settings overview
34+
35+
table
36+
tr
37+
th Name
38+
th Type
39+
th Description
40+
41+
tr
42+
td registryUrls
43+
td: code string[]
44+
td Search the given registry URL first when resolving dependencies. Can be specified multiple times. Available registry types:
45+
ul
46+
li DUB: URL to DUB registry (default)
47+
li Maven: URL to Maven repository + group id containing dub packages as artifacts. E.g. mvn+http://localhost:8040/maven/libs-release/dubpackages
48+
49+
tr
50+
td skipRegistry
51+
td: code string
52+
td Sets a mode for skipping the search on certain package registry types:
53+
ul
54+
li none: Search all configured or default registries (default)
55+
li standard: Don't search the main registry (e.g. https://code.dlang.org/)
56+
li configured: Skip all default and user configured registries
57+
li all: Only search registries specified with --registry
58+
59+
tr
60+
td customCachePaths
61+
td: code string[]
62+
td
63+
p Additional paths that contain packages in subfolders with the pattern "(name)-(version)/(name)/".
64+
p Can be used to provide prebuilt DUB libraries (e.g. for distribution package maintainers).
65+
66+
tr
67+
td defaultCompiler
68+
td: code string
69+
td
70+
p Specifies the compiler binary to use (can be a path).
71+
p Arbitrary pre- and suffixes to the identifiers below are recognized (e.g. ldc2 or dmd-2.063) and matched to the proper compiler type: dmd, gdc, ldc, gdmd, ldmd
72+
73+
tr
74+
td defaultArchitecture
75+
td: code string
76+
td Force a different architecture (e.g. x86 or x86_64)

0 commit comments

Comments
 (0)