<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build(ctx, less=False, docs=False, js=False, force=False):
 """Build everything and collectstatic. """

    specified = any([less, docs, js])
    buildall = not specified

    if buildall or less:
        less_fname = ctx.pkg.source_less / ctx.pkg.name + '.less'
        if less_fname.exists():
            lessc.LessRule(
                ctx,
                src='{pkg.source_less}/{pkg.name}.less',
                dst='{pkg.django_static}/{pkg.name}/css/{pkg.name}-{version}.min.css',
                force=force
            )
        elif less:
            print("WARNING: build --less specified, but no file at:", less_fname)

    if buildall or docs:
        if WARN_ABOUT_SETTINGS:
            warnings.warn(
                "autodoc might need a dummy settings file in the root of "
                "your package. Since it runs in a separate process you cannot"
                "use settings.configure()"
            )
        doctools.build(ctx, force=force)

    if buildall or js:
        build_js(ctx, force)

    if HAVE_SETTINGS and (force or changed(ctx.pkg.django_static)):
        collectstatic(ctx, DJANGO_SETTINGS_MODULE)