Example #1
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")

    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("unitTests", "Run Unit Tests")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")

    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("lint", "Run lint workflow",
                             ['debug', 'lintCmake', 'lintCppWithInlineChange'])

    buildOptions.addWorkflow("build", "Production Build", [
        'debug', 'lintCmake', 'lintCpp', 'makeBuildDirectory',
        'generateProject', 'buildTargetLibrary', 'unitTests'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    nfbuild = NFBuildOSX()
    library_target = "NFLoggerTest"

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject()

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'unitTests'):
        nfbuild.runUnitTests()
Example #2
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")
    buildOptions.addOption("installDependencies", "Install dependencies")
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("integrationTests", "Run Integration Tests")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")

    buildOptions.addOption("addressSanitizer",
                           "Enable Address Sanitizer in generate project")
    buildOptions.addOption("codeCoverage",
                           "Enable code coverage in generate project")
    buildOptions.addOption("curl", "Use curl in generate project")
    buildOptions.addOption("cpprest", "Use cpprest in generate project")

    buildOptions.addOption("buildTargetCLI", "Build Target: CLI")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("gnuToolchain", "Build with gcc and libstdc++")
    buildOptions.addOption("llvmToolchain", "Build with clang and libc++")

    buildOptions.addOption("staticAnalysis", "Run Static Analysis")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("local_it", "Run local integration tests", [
        'debug',
        'integrationTests'
    ])

    buildOptions.addWorkflow("lint", "Run lint workflow", [
        'lintCppWithInlineChange'
    ])

    buildOptions.addWorkflow("address_sanitizer", "Run address sanitizer", [
        'debug',
        'lintCpp',
        'makeBuildDirectory',
        'generateProject',
        'addressSanitizer',
        'buildTargetCLI',
        'integrationTests'
    ])

    buildOptions.addWorkflow("code_coverage", "Collect code coverage", [
        'debug',
        'lintCpp',
        'makeBuildDirectory',
        'generateProject',
        'codeCoverage',
        'buildTargetCLI',
        'integrationTests'
    ])

    buildOptions.addWorkflow("build", "Production Build", [
        'lintCpp',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetCLI',
        'buildTargetLibrary',
        'staticAnalysis',
        'integrationTests'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFHTTP'
    cli_target = 'NFHTTPCLI'
    nfbuild = NFBuildOSX()

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(
            code_coverage='codeCoverage' in options,
            address_sanitizer='addressSanitizer' in options,
            use_curl='curl' in options,
            use_cpprest='cpprest' in options
        )

    if buildOptions.checkOption(options, 'generateProject'):
        if buildOptions.checkOption(options, 'gnuToolchain'):
            os.environ['CC'] = 'gcc-4.9'
            os.environ['CXX'] = 'g++-4.9'
            nfbuild.generateProject(gcc=True)
        elif buildOptions.checkOption(options, 'llvmToolchain'):
            os.environ['CC'] = 'clang-3.9'
            os.environ['CXX'] = 'clang++-3.9'
            nfbuild.generateProject(gcc=False)
        else:
            nfbuild.generateProject()

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)
        if buildOptions.checkOption(options, 'staticAnalysis'):
            nfbuild.staticallyAnalyse(library_target,
                                      include_regex='source/.*')

    if buildOptions.checkOption(options, 'buildTargetCLI'):
        nfbuild.buildTarget(cli_target)
        if buildOptions.checkOption(options, 'staticAnalysis'):
            nfbuild.staticallyAnalyse(cli_target,
                                      include_regex='source/.*')

    if buildOptions.checkOption(options, 'integrationTests'):
        nfbuild.runIntegrationTests()

    if buildOptions.checkOption(options, 'codeCoverage'):
        nfbuild.collectCodeCoverage()
Example #3
0
def main():

    buildOptions = BuildOptions()
    buildOptions.addOption("deploy", "Do deployment")

    buildOptions.addOption("integrationTests", "Run Integration Tests")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")
    buildOptions.addOption("addressSanitizer",
                           "Enable Address Sanitizer in generate project")
    buildOptions.addOption("mockLoggingService",
                           "Enable logging service mock in generate project")

    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("gnuToolchain", "Build with gcc and libstdc++")
    buildOptions.addOption("llvmToolchain", "Build with clang and libc++")

    buildOptions.addOption("makeCLI", "Deploy CLI Binary")
    buildOptions.addOption("makeJAR", "Deploy JAR")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("clang_build", "Production Clang Build", [
        'llvmToolchain', 'makeBuildDirectory', 'generateProject',
        'buildTargetLibrary', 'makeCLI', 'integrationTests'
    ])

    buildOptions.addWorkflow("gcc_build", "Production build with gcc", [
        'gnuToolchain',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'makeCLI',
        'integrationTests',
    ])

    buildOptions.addWorkflow("address_sanitizer", "Run address sanitizer", [
        'makeBuildDirectory', 'generateProject', 'addressSanitizer',
        'mockLoggingService', 'buildTargetLibrary', 'makeCLI',
        'integrationTests'
    ])

    buildOptions.addWorkflow("build", "Production Build", [
        'makeBuildDirectory', 'generateProject', 'buildTargetLibrary',
        'makeCLI', 'makeJAR'
    ])

    options = buildOptions.parseArgs()

    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFSmartPlayer'
    nfbuild = NFBuildLinux()

    if buildOptions.checkOption(options, 'deploy'):
        nfbuild.deploy_artifacts = True

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        if buildOptions.checkOption(options, 'gnuToolchain'):
            os.environ['CC'] = 'gcc'
            os.environ['CXX'] = 'g++'
            nfbuild.generateProject(address_sanitizer='addressSanitizer'
                                    in options,
                                    gcc=True)
        elif buildOptions.checkOption(options, 'llvmToolchain'):
            os.environ['CC'] = 'clang'
            os.environ['CXX'] = 'clang++'
            nfbuild.generateProject(address_sanitizer='addressSanitizer'
                                    in options,
                                    gcc=False)
        else:
            nfbuild.generateProject(
                address_sanitizer='addressSanitizer' in options)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'makeCLI'):
        nfbuild.makeCLI()

    if buildOptions.checkOption(options, 'makeJAR'):
        nfbuild.makeJAR()

    if buildOptions.checkOption(options, 'integrationTests'):
        nfbuild.runIntegrationTests()
Example #4
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("installDependencies", "Install dependencies")
    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate project")

    buildOptions.addOption("buildTargetCLI", "Build Target: CLI")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("packageArtifacts", "Package the binary artifacts")
    buildOptions.addOption("gnuToolchain", "Build with gcc and libstdc++")
    buildOptions.addOption("llvmToolchain", "Build with clang and libc++")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("lint", "Run lint workflow", [
        'installDependencies',
        'lintCmake',
        'lintCppWithInlineChange'
    ])

    buildOptions.addWorkflow("clang_build", "Production build with clang", [
        'llvmToolchain',
        'installDependencies',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'buildTargetCLI',
        'packageArtifacts'
    ])

    buildOptions.addWorkflow("gcc_build", "Production build with gcc", [
        'gnuToolchain',
        'installDependencies',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'buildTargetCLI',
        'packageArtifacts'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFDriver'
    cli_target = 'NFDriverCLI'
    nfbuild = NFBuildLinux()

    if buildOptions.checkOption(options, 'installDependencies'):
        nfbuild.installDependencies()

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        if buildOptions.checkOption(options, 'gnuToolchain'):
            os.environ['CC'] = 'gcc-4.9'
            os.environ['CXX'] = 'g++-4.9'
            nfbuild.generateProject(gcc=True)
        elif buildOptions.checkOption(options, 'llvmToolchain'):
            os.environ['CC'] = 'clang-3.9'
            os.environ['CXX'] = 'clang++-3.9'
            nfbuild.generateProject(gcc=False)
        else:
            nfbuild.generateProject()

    if buildOptions.checkOption(options, 'buildTargetCLI'):
        nfbuild.buildTarget(cli_target)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'packageArtifacts'):
        nfbuild.packageArtifacts()
Example #5
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")
    buildOptions.addOption("installDependencies", "Install dependencies")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")
    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate project")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("gnuToolchain", "Build with gcc and libstdc++")
    buildOptions.addOption("llvmToolchain", "Build with clang and libc++")
    buildOptions.addOption("runIntegrationTests", "Run the integration tests")
    buildOptions.addOption("packageArtifacts", "Package the Artifacts")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("lint", "Run lint workflow", [
        'lintCppWithInlineChange'
    ])

    buildOptions.addWorkflow("clang_build", "Production Clang Build", [
        'llvmToolchain',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'runIntegrationTests',
        'packageArtifacts'
    ])

    buildOptions.addWorkflow("gcc_build", "Production build with gcc", [
        'gnuToolchain',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'runIntegrationTests',
        'packageArtifacts'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFHTTP'
    nfbuild = NFBuildLinux()

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        if buildOptions.checkOption(options, 'gnuToolchain'):
            os.environ['CC'] = 'gcc'
            os.environ['CXX'] = 'g++'
            nfbuild.generateProject(gcc=True)
        elif buildOptions.checkOption(options, 'llvmToolchain'):
            os.environ['CC'] = 'clang'
            os.environ['CXX'] = 'clang++'
            nfbuild.generateProject(gcc=False)
        else:
            nfbuild.generateProject()

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)
    if buildOptions.checkOption(options, "runIntegrationTests"):
        nfbuild.runIntegrationTests()
    if buildOptions.checkOption(options, 'packageArtifacts'):
        nfbuild.packageArtifacts()
Example #6
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("installDependencies", "Install dependencies")
    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate project")
    buildOptions.addOption("buildTargetCLI", "Build Target: CLI")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("packageArtifacts", "Package the binary artifacts")
    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("build", "Production Build", [
        'installDependencies', 'makeBuildDirectory', 'generateProject',
        'buildTargetCLI', 'buildTargetLibrary', 'packageArtifacts'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFDriver'
    cli_target = 'NFDriverCLI'
    nfbuild = NFBuildWindows()

    if buildOptions.checkOption(options, 'installDependencies'):
        nfbuild.installDependencies()

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(ios=True)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'buildTargetCLI'):
        nfbuild.buildTarget(cli_target)

    if buildOptions.checkOption(options, "packageArtifacts"):
        nfbuild.packageArtifacts()
Example #7
0
def main():
    buildOptions = BuildOptions()

    buildOptions.addOption("makeBuildDirectoryX86",
                           "Wipe existing build directory for X86 build.")
    buildOptions.addOption("generateProjectX86",
                           "Regenerate project for X86 build")

    buildOptions.addOption("buildTargetLibraryX86",
                           "Build Target: Library (X86)")

    buildOptions.addOption("makeBuildDirectoryArm64",
                           "Wipe existing build directory for ARM64 build.")
    buildOptions.addOption("generateProjectArm64",
                           "Regenerate project for ARM64 build")
    buildOptions.addOption("packageArtifactsArm64",
                           "Package the artifacts produced by the build")
    buildOptions.addOption("packageArtifactsX86",
                           "Package the artifacts produced by the build")
    buildOptions.addOption("buildTargetLibraryArm64",
                           "Build Target: Library (ARM64)")
    buildOptions.addOption("makeCLI", "Deploy CLI Binary")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("build", "Production Build (Android Linux)", [
        'makeBuildDirectoryX86', 'generateProjectX86', 'buildTargetLibraryX86',
        'packageArtifactsX86', 'makeBuildDirectoryArm64',
        'generateProjectArm64', 'buildTargetLibraryArm64',
        'packageArtifactsArm64'
    ])

    buildOptions.addWorkflow("buildX86", "Production Build (X86)", [
        'makeBuildDirectoryX86', 'generateProjectX86', 'buildTargetLibraryX86',
        'packageArtifactsX86'
    ])

    buildOptions.addWorkflow("buildArm64", "Production Build (ARM64)", [
        'makeBuildDirectoryArm64', 'generateProjectArm64',
        'buildTargetLibraryArm64', 'packageArtifactsArm64'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFSmartPlayer'
    nfbuild = NFBuildLinux()

    if buildOptions.checkOption(options, 'makeBuildDirectoryX86'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProjectX86'):
        nfbuild.generateProject(android=True, android_arm=False)

    if buildOptions.checkOption(options, 'buildTargetLibraryX86'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'packageArtifactsX86'):
        nfbuild.packageArtifacts(android=True, android_arm=False)

    if buildOptions.checkOption(options, 'packageArtifactsArm64'):
        nfbuild.packageArtifacts(android=True, android_arm=True)

    if buildOptions.checkOption(options, 'makeBuildDirectoryArm64'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProjectArm64'):
        nfbuild.generateProject(android=True, android_arm=True)

    if buildOptions.checkOption(options, 'buildTargetLibraryArm64'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'makeCLI'):
        nfbuild.makeCLI()
Example #8
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")
    buildOptions.addOption("installDependencies", "Install dependencies")
    buildOptions.addOption("packageArtifacts", "Package the binary artifacts")
    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("unitTests", "Run Unit Tests")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")

    buildOptions.addOption("generateProject", "Regenerate xcode project")
    buildOptions.addOption("addressSanitizer",
                           "Enable Address Sanitizer in generate project")
    buildOptions.addOption("codeCoverage",
                           "Enable code coverage in generate project")

    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow(
        "local_unit", "Run local unit tests",
        ['debug', 'installDependencies', 'lintCmake', 'unitTests'])

    buildOptions.addWorkflow("lint", "Run lint workflow", [
        'debug', 'installDependencies', 'lintCmake', 'lintCppWithInlineChange'
    ])

    buildOptions.addWorkflow("build", "Production Build", [
        'debug', 'installDependencies', 'lintCmake', 'lintCpp',
        'makeBuildDirectory', 'generateProject', 'buildTargetLibrary',
        'unitTests', 'packageArtifacts'
    ])

    buildOptions.addWorkflow("code_coverage", "Collect code coverage", [
        'debug', 'installDependencies', 'lintCmake', 'lintCpp',
        'makeBuildDirectory', 'generateProject', 'codeCoverage', 'unitTests'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFParamTests'
    nfbuild = NFBuildOSX()

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'installDependencies'):
        nfbuild.installDependencies()

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(code_coverage='codeCoverage' in options,
                                address_sanitizer='addressSanitizer'
                                in options)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'unitTests'):
        nfbuild.runUnitTests()

    if buildOptions.checkOption(options, 'codeCoverage'):
        nfbuild.collectCodeCoverage()
    if buildOptions.checkOption(options, 'packageArtifacts'):
        nfbuild.packageArtifacts()
Example #9
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")

    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("integrationTests", "Run Integration Tests")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")

    buildOptions.addOption("addressSanitizer",
                           "Enable Address Sanitizer in generate project")
    buildOptions.addOption("ubSanitizer",
                           "Enable UB Sanitizer in generate project")
    buildOptions.addOption("codeCoverage",
                           "Enable code coverage in generate project")
    buildOptions.addOption("ffmpeg", "Use ffmpeg for decode")

    buildOptions.addOption("printStackTrace", "Enable print stack trace")

    buildOptions.addOption("buildTargetCLI", "Build Target: CLI")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")

    buildOptions.addOption("staticAnalysis", "Run Static Analysis")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("local_it", "Run local integration tests",
                             ['debug', 'lintCmake', 'integrationTests'])

    buildOptions.addWorkflow("lint", "Run lint workflow",
                             ['lintCmake', 'lintCppWithInlineChange'])

    buildOptions.addWorkflow("address_sanitizer", "Run address sanitizer", [
        'lintCmake', 'lintCpp', 'makeBuildDirectory', 'generateProject',
        'addressSanitizer', 'buildTargetCLI', 'integrationTests'
    ])

    buildOptions.addWorkflow("ub_sanitizer", "Run UB sanitizer", [
        'printStackTrace', 'lintCmake', 'lintCpp', 'makeBuildDirectory',
        'generateProject', 'ubSanitizer', 'buildTargetCLI', 'integrationTests'
    ])

    buildOptions.addWorkflow("code_coverage", "Collect code coverage", [
        'debug', 'lintCmake', 'lintCpp', 'makeBuildDirectory',
        'generateProject', 'codeCoverage', 'buildTargetCLI', 'integrationTests'
    ])

    buildOptions.addWorkflow("build", "Production Build", [
        'lintCmake', 'lintCpp', 'makeBuildDirectory', 'generateProject',
        'buildTargetCLI', 'buildTargetLibrary', 'staticAnalysis',
        'integrationTests'
    ])

    options = buildOptions.parseArgs()

    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFDecoder'
    cli_target = 'NFDecoderCLI'
    nfbuild = NFBuildOSX()

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'printStackTrace'):
        os.environ['UBSAN_OPTIONS'] = 'print_stacktrace=1'

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(code_coverage='codeCoverage' in options,
                                address_sanitizer='addressSanitizer'
                                in options,
                                ub_sanitizer='ubSanitizer' in options,
                                use_ffmpeg='ffmpeg' in options)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)
        if buildOptions.checkOption(options, 'staticAnalysis'):
            nfbuild.staticallyAnalyse(library_target,
                                      include_regex='source/.*')

    if buildOptions.checkOption(options, 'buildTargetCLI'):
        nfbuild.buildTarget(cli_target)
        if buildOptions.checkOption(options, 'staticAnalysis'):
            nfbuild.staticallyAnalyse(cli_target, include_regex='source/.*')

    if buildOptions.checkOption(options, 'integrationTests'):
        nfbuild.runIntegrationTests()

    if buildOptions.checkOption(options, 'codeCoverage'):
        nfbuild.collectCodeCoverage()
Example #10
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("installDependencies", "Install dependencies")

    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")

    buildOptions.addOption("buildTargetCLI", "Build Target: CLI")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")

    buildOptions.addOption("staticAnalysis", "Run Static Analysis")

    buildOptions.addOption("makeCLI", "Deploy CLI Binary")
    buildOptions.addOption("packageArtifacts",
                           "Package the artifacts produced by the build")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow(
        "lint", "Run lint workflow",
        ['installDependencies', 'lintCmake', 'lintCppWithInlineChange'])

    buildOptions.addWorkflow("build", "Production Build", [
        'installDependencies', 'lintCmake', 'lintCpp', 'makeBuildDirectory',
        'generateProject', 'buildTargetCLI', 'buildTargetLibrary',
        'staticAnalysis', 'packageArtifacts'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    nfbuild = NFBuildOSX()
    library_target = 'NFDriver'
    cli_target = 'NFDriverCLI'

    if buildOptions.checkOption(options, 'installDependencies'):
        nfbuild.installDependencies()

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject()

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)
        if buildOptions.checkOption(options, 'staticAnalysis'):
            nfbuild.staticallyAnalyse(library_target,
                                      include_regex='source/.*')

    if buildOptions.checkOption(options, 'buildTargetCLI'):
        nfbuild.buildTarget(cli_target)
        if buildOptions.checkOption(options, 'staticAnalysis'):
            nfbuild.staticallyAnalyse(cli_target, include_regex='source/.*')
    if buildOptions.checkOption(options, "packageArtifacts"):
        nfbuild.packageArtifacts()
Example #11
0
def main():

    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")
    buildOptions.addOption("lintPython", "Lint python files")
    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")

    buildOptions.addOption("buildTargetIphoneSimulator",
                           "Build Target: iPhone Simulator")
    buildOptions.addOption("buildTargetIphoneOS", "Build Target: iPhone OS")

    buildOptions.addOption("makeUniversalBinary", "Make Universal Binary")
    buildOptions.addOption("makeIOSFramework", "Make IOS Framework")
    buildOptions.addOption("makeIOSStaticLibrary", "Make IOS Static Library")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow(
        "lint", "Run lint workflow",
        ['lintPython', 'lintCmake', 'lintCppWithInlineChange'])

    buildOptions.addWorkflow("build", "Production Build", [
        'lintPython', 'lintCmake', 'lintCpp', 'makeBuildDirectory',
        'generateProject', 'buildTargetIphoneSimulator', 'buildTargetIphoneOS',
        'makeUniversalBinary', 'makeIOSFramework', 'makeIOSStaticLibrary'
    ])

    framework_target = 'NFSmartPlayerObjC'
    nfbuild = NFBuildOSX()

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'lintPython'):
        nfbuild.lintPython()

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(ios=True)

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'buildTargetIphoneSimulator'):
        nfbuild.buildTarget(framework_target,
                            sdk='iphonesimulator',
                            arch='x86_64')

    if buildOptions.checkOption(options, 'buildTargetIphoneOS'):
        nfbuild.buildTarget(framework_target, sdk='iphoneos', arch='arm64')

    if buildOptions.checkOption(options, 'makeUniversalBinary'):
        nfbuild.makeUniversalBinary()

    if buildOptions.checkOption(options, 'makeIOSFramework'):
        nfbuild.makeIOSFramework()

    if buildOptions.checkOption(options, 'makeIOSStaticLibrary'):
        nfbuild.makeIOSStaticLibrary()
Example #12
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("debug", "Enable Debug Mode")
    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("gnuToolchain", "Build with gcc and libstdc++")
    buildOptions.addOption("llvmToolchain", "Build with clang and libc++")
    buildOptions.addOption("integrationTests", "Run Integration Tests")
    buildOptions.addOption("addressSanitizer",
                           "Enable Address Sanitizer in generate project")
    # buildOptions.addOption("packageArtifacts", "Package the Artifacts")
    buildOptions.addOption("ubSanitizer",
                           "Enable UB Sanitizer in generate project")
    buildOptions.addOption("memSanitizer",
                           "Enable Mem Sanitizer in generate project")

    buildOptions.addOption("printStackTrace",
                           "Enable print stack trace")

    buildOptions.addOption("buildTargetCLI", "Build Target: CLI")
    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    # TODO: Check if we need package artifacts
    buildOptions.addWorkflow("clang_build", "Production Clang Build", [
        'llvmToolchain',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetCLI',
        'buildTargetLibrary',
        'integrationTests'
    ])

    buildOptions.addWorkflow("gcc_build", "Production build with gcc", [
        'gnuToolchain',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetCLI',
        'buildTargetLibrary',
        'integrationTests',
    ])

    buildOptions.addWorkflow("local_it", "Run local integration tests", [
        'debug',
        'lintCmake',
        'integrationTests'
    ])

    buildOptions.addWorkflow("ub_sanitizer", "Run UB sanitizer", [
        'printStackTrace',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'ubSanitizer',
        'buildTargetCLI',
        'integrationTests'
    ])

    buildOptions.addWorkflow("mem_sanitizer", "Run Mem sanitizer", [
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'memSanitizer',
        'buildTargetCLI',
        'integrationTests'
    ])

    buildOptions.addWorkflow("address_sanitizer", "Run address sanitizer", [
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'addressSanitizer',
        'buildTargetCLI',
        'integrationTests'
    ])

    buildOptions.addWorkflow("build", "Production Build", [
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'buildTargetCLI'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFDecoder'
    cli_target = 'NFDecoderCLI'
    nfbuild = NFBuildLinux()

    if buildOptions.checkOption(options, 'debug'):
        nfbuild.build_type = 'Debug'

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'printStackTrace'):
        os.environ['UBSAN_OPTIONS=print_stacktrace'] = '1'

    if buildOptions.checkOption(options, 'generateProject'):
        if buildOptions.checkOption(options, 'gnuToolchain'):
            os.environ['CC'] = 'gcc'
            os.environ['CXX'] = 'g++'
            nfbuild.generateProject(address_sanitizer='addressSanitizer' in options,
                                    ub_sanitizer='ubSanitizer' in options,
                                    mem_sanitizer='memSanitizer' in options,
                                    gcc=True)
        elif buildOptions.checkOption(options, 'llvmToolchain'):
            os.environ['CC'] = 'clang'
            os.environ['CXX'] = 'clang++'
            nfbuild.generateProject(address_sanitizer='addressSanitizer' in options,
                                    ub_sanitizer='ubSanitizer' in options,
                                    mem_sanitizer='memSanitizer' in options,
                                    gcc=False)
        else:
            nfbuild.generateProject(address_sanitizer='addressSanitizer' in options,
                                    ub_sanitizer='ubSanitizer' in options,
                                    mem_sanitizer='memSanitizer' in options)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'buildTargetCLI'):
        nfbuild.buildTarget(cli_target)

    if buildOptions.checkOption(options, 'integrationTests'):
        nfbuild.runIntegrationTests()
Example #13
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("installDependencies", "Install dependencies")

    buildOptions.addOption("makeBuildDirectoryX86",
                           "Wipe existing build directory for X86 build.")
    buildOptions.addOption("generateProjectX86",
                           "Regenerate project for X86 build")

    buildOptions.addOption("buildTargetLibraryX86",
                           "Build Target: Library (X86)")

    buildOptions.addOption("makeBuildDirectoryArm64",
                           "Wipe existing build directory for ARM64 build.")
    buildOptions.addOption("generateProjectArm64",
                           "Regenerate project for ARM64 build")

    buildOptions.addOption("buildTargetLibraryArm64",
                           "Build Target: Library (ARM64)")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("build", "Production Build", [
        'installDependencies', 'makeBuildDirectoryX86', 'generateProjectX86',
        'buildTargetLibraryX86', 'makeBuildDirectoryArm64',
        'generateProjectArm64', 'buildTargetLibraryArm64'
    ])

    buildOptions.addWorkflow("buildX86", "Production Build (X86)", [
        'installDependencies', 'makeBuildDirectoryX86', 'generateProjectX86',
        'buildTargetLibraryX86'
    ])

    buildOptions.addWorkflow("buildArm64", "Production Build (ARM64)", [
        'installDependencies', 'makeBuildDirectoryArm64',
        'generateProjectArm64', 'buildTargetLibraryArm64'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFDriver'
    nfbuild = NFBuildWindows()

    if buildOptions.checkOption(options, 'installDependencies'):
        nfbuild.installDependencies(android=True)

    if buildOptions.checkOption(options, 'makeBuildDirectoryX86'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProjectX86'):
        nfbuild.generateProject(android=True, android_arm=False)

    if buildOptions.checkOption(options, 'buildTargetLibraryX86'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'makeBuildDirectoryArm64'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProjectArm64'):
        nfbuild.generateProject(android=False, android_arm=True)

    if buildOptions.checkOption(options, 'buildTargetLibraryArm64'):
        nfbuild.buildTarget(library_target)
Example #14
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("lintCmake", "Lint cmake files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")

    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")

    buildOptions.addOption("buildTargetLibrary", "Build Target: Library")
    buildOptions.addOption("gnuToolchain", "Build with gcc and libstdc++")
    buildOptions.addOption("llvmToolchain", "Build with clang and libc++")

    buildOptions.addOption("unitTests", "Run Unit Tests")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("lint", "Run lint workflow", [
        'lintCmake',
        'lintCppWithInlineChange'
    ])

    buildOptions.addWorkflow("clang_build", "Production Build", [
        'llvmToolchain',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'unitTests'
    ])

    buildOptions.addWorkflow("gcc_build", "Production Build", [
        'gnuToolchain',
        'lintCmake',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetLibrary',
        'unitTests'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    nfbuild = NFBuildLinux()
    library_target = "NFLoggerTest"

    if buildOptions.checkOption(options, 'lintCmake'):
        nfbuild.lintCmake()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        if buildOptions.checkOption(options, 'gnuToolchain'):
            os.environ['CC'] = 'gcc'
            os.environ['CXX'] = 'g++'
            nfbuild.generateProject(address_sanitizer='addressSanitizer' in options,
                                    undefined_behaviour_sanitizer='ubSanitizer' in options,
                                    gcc=True)
        elif buildOptions.checkOption(options, 'llvmToolchain'):
            os.environ['CC'] = 'clang'
            os.environ['CXX'] = 'clang++'
            nfbuild.generateProject(address_sanitizer='addressSanitizer' in options,
                                    undefined_behaviour_sanitizer='ubSanitizer' in options,
                                    gcc=False)
        else:
            nfbuild.generateProject(address_sanitizer='addressSanitizer' in options,
                                    undefined_behaviour_sanitizer='ubSanitizer' in options)

    if buildOptions.checkOption(options, 'buildTargetLibrary'):
        nfbuild.buildTarget(library_target)

    if buildOptions.checkOption(options, 'unitTests'):
        nfbuild.runUnitTests()
Example #15
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("lintCpp", "Lint CPP Files")
    buildOptions.addOption("lintCppWithInlineChange",
                           "Lint CPP Files and fix them")
    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")
    buildOptions.addOption("buildTargetIphoneSimulator",
                           "Build Target: iPhone Simulator")
    buildOptions.addOption("buildTargetIphoneOS", "Build Target: iPhone OS")

    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("lint", "Run lint workflow",
                             ['lintCppWithInlineChange'])

    buildOptions.addWorkflow("build", "Production Build", [
        'lintCpp',
        'makeBuildDirectory',
        'generateProject',
        'buildTargetIphoneSimulator',
        'buildTargetIphoneOS',
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFHTTP'
    nfbuild = NFBuildOSX()

    if buildOptions.checkOption(options, 'lintCppWithInlineChange'):
        nfbuild.lintCPP(make_inline_changes=True)
    elif buildOptions.checkOption(options, 'lintCpp'):
        nfbuild.lintCPP(make_inline_changes=False)

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(ios=True)

    if buildOptions.checkOption(options, 'buildTargetIphoneSimulator'):
        nfbuild.buildTarget(library_target,
                            sdk='iphonesimulator',
                            arch='x86_64')

    if buildOptions.checkOption(options, 'buildTargetIphoneOS'):
        nfbuild.buildTarget(library_target, sdk='iphoneos', arch='arm64')
Example #16
0
def main():
    buildOptions = BuildOptions()
    buildOptions.addOption("installDependencies", "Install dependencies")
    buildOptions.addOption("makeBuildDirectory",
                           "Wipe existing build directory")
    buildOptions.addOption("generateProject", "Regenerate xcode project")
    buildOptions.addOption("buildTargetIphoneSimulator",
                           "Build Target: iPhone Simulator")
    buildOptions.addOption("buildTargetIphoneOS", "Build Target: iPhone OS")
    buildOptions.addOption("staticAnalysis", "Run Static Analysis")
    buildOptions.addOption("packageArtifacts",
                           "Package the artifacts produced by the build")
    buildOptions.setDefaultWorkflow("Empty workflow", [])

    buildOptions.addWorkflow("build", "Production Build", [
        'installDependencies', 'makeBuildDirectory', 'generateProject',
        'buildTargetIphoneSimulator', 'buildTargetIphoneOS', 'staticAnalysis',
        'packageArtifacts'
    ])

    options = buildOptions.parseArgs()
    buildOptions.verbosePrintBuildOptions(options)

    library_target = 'NFDriver'
    nfbuild = NFBuildOSX()

    if buildOptions.checkOption(options, 'installDependencies'):
        nfbuild.installDependencies()

    if buildOptions.checkOption(options, 'makeBuildDirectory'):
        nfbuild.makeBuildDirectory()

    if buildOptions.checkOption(options, 'generateProject'):
        nfbuild.generateProject(ios=True)

    if buildOptions.checkOption(options, 'buildTargetIphoneSimulator'):
        nfbuild.buildTarget(library_target,
                            sdk='iphonesimulator',
                            arch='x86_64')

    if buildOptions.checkOption(options, 'buildTargetIphoneOS'):
        nfbuild.buildTarget(library_target, sdk='iphoneos', arch='arm64')

    if buildOptions.checkOption(options, 'staticAnalysis'):
        nfbuild.staticallyAnalyse(library_target, include_regex='source/.*')
    if buildOptions.checkOption(options, "packageArtifacts"):
        nfbuild.packageArtifacts()