Am 30.10.2014 11:03, schrieb Suliman:

{
	"name": "d-html-parser",
	"sourceFiles": ["dhtmlparser.d", "quote_escaper.d"],
	"importPaths": ["."]
}

Ideally, the two source files would be moved to a "source" or "src"
folder. That would avoid possible import conflicts and would mean than
only the name needs to be put into dub.json - the rest gets inferred then.

"library"? Whu not "sourceLibrary"?

"library" is usually the recommended choice. It gives the user control
over how the library is built (as a static library by default, or as a
source library using the --combined switch). Later it could also be
made possible for a package to configure how a dependency is built.

"sourceLibrary" mainly makes sense for libraries where you always want
to avoid that they produce a binary during the build process (header
only C bindings are the prime example).

ok, I moved this 2 files at src folder.

Am I right understand that I do not need to specify their names, bacause all of files from src would be imported?

I do not need to specify importPaths because it will do search all files in current folder?

Exactly. All .d files are recursively added and the "src" folder itself
is added as an import path.

I wrote next dyb.json file:

{
	"name": "DHTMLParser",
	"description": "A minimal D application.",
	"copyright": "Copyright © 2014, Suliman",
	"targetType": "sourceLibrary",
	"authors": ["Suliman"],
	"dependencies": {
	}
}

but I am getting error:
"Error executing command run: Main package must have a binary target type, not sourceLibrary. Cannot build."

This is because "sourceLibrary" specifically means "include the
sources in build command for the parent package and do not produce a
separate binary". You can still use it as a dependency, though, just not
perform a stand-alone build.

with:
"targetType": "library",

error:

Building dhtmlparser ~master configuration "library", build type debug.
Running dmd...
source\dhtmlparser.d(382): Warning: else is dangling, add { } after condition at
  source\dhtmlparser.d(379)
source\dhtmlparser.d(390): Warning: else is dangling, add { } after condition at
  source\dhtmlparser.d(386)
source\dhtmlparser.d(884): Warning: else is dangling, add { } after condition at
  source\dhtmlparser.d(881)
FAIL .dub\build\library-debug-windows-x86-dmd_2066-CA3B61C3E83E5D50F59F152BAC903
747\ dhtmlparser staticLibrary
Error executing command run: dmd failed with exit code 1.

By default, warnings are treated as errors by DUB. You could add
"buildRequirements": ["allowWarnings"] or "silenceWarnings" to
ignore them instead. But of course I'd recommend to fix the warnings
instead by adding additional braces around the code, because DMD's
warnings are usually pretty helpful in avoiding some classes of bugs.