Changeset 7e288c4 for Jenkinsfile


Ignore:
Timestamp:
Aug 17, 2018, 1:05:44 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
eb0938ca
Parents:
47b3235
Message:

Remove redundant booleans in Jenkinsfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r47b3235 r7e288c4  
    44// Main loop of the compilation
    55//===========================================================================================================
    6 set -x
    7 
    86node ('master'){
    97
     
    1311
    1412        stage_name              = ''
    15 
    16         compiler                = null
    17         arch_name               = ''
    18         architecture    = ''
    19 
    20         do_alltests             = false
    21         do_benchmark    = false
    22         do_doc          = false
    23         do_publish              = false
    24         do_sendemail    = true
    2513
    2614        builddir = pwd tmp: true
     
    7260        finally {
    7361                //Send email with final results if this is not a full build
    74                 if( do_sendemail ) {
     62                if( !params.Silent ) {
    7563                        echo 'Notifying users of result'
    7664                        email(currentBuild.result, log_needed, bIsSandbox)
     
    150138                ]])
    151139
    152         compiler                = compiler_from_params( params.Compiler )
    153         arch_name               = params.Architecture
    154         architecture    = architecture_from_params( arch_name )
    155 
    156         do_alltests             = (params.RunAllTests == 'true')
    157         do_benchmark    = (params.RunBenchmark == 'true')
    158         do_doc          = (params.BuildDocumentation == 'true')
    159         do_publish              = (params.Publish == 'true')
    160         do_sendemail    = ! (params.Silent == 'true')
    161 
    162         echo params.RunAllTests.getClass().toString();
     140        params.Compiler   = compiler_from_params( params.Compiler )
     141        params.Architecture = architecture_from_params( params.Architecture )
    163142
    164143        collect_git_info()
    165144
    166         def full = do_alltests ? " (Full)" : ""
    167         currentBuild.description = "${compiler.cc_name}:${arch_name}${full}"
    168 
    169         echo """Compiler                 : ${ compiler.cc_name } (${ compiler.cpp_cc }/${ compiler.cfa_cc })
    170 Architecture            : ${ arch_name }
    171 Arc Flags               : ${ architecture }
     145        def full = params.RunAllTests ? " (Full)" : ""
     146        currentBuild.description = "${ params.Compiler.cc_name }:${ params.Architecture.name }${full}"
     147
     148        echo """Compiler                 : ${ params.Compiler.cc_name } (${ params.Compiler.cpp_cc }/${ params.Compiler.cfa_cc })
     149Architecture            : ${ params.Architecture.name }
     150Arc Flags               : ${ params.Architecture.flags }
    172151Run All Tests           : ${ params.RunAllTests.toString() }
    173152Run Benchmark           : ${ params.RunBenchmark.toString() }
     
    235214}
    236215
     216//Description of an architecture (Must be serializable since pipelines are persistent)
     217class CC_Desc implements Serializable {
     218        public String name
     219        public String flags
     220
     221        CC_Desc(String name, String flags) {
     222                this.name  = name
     223                this.flags = flags
     224        }
     225}
     226
    237227def architecture_from_params( arch ) {
    238228        switch( arch ) {
    239229                case 'x64':
    240                         return '--host=x86_64'
     230                        return new CC_Desc('x64', '--host=x86_64')
    241231                break
    242232                case 'x86':
    243                         return '--host=i386'
     233                        return new CC_Desc('x86', '--host=i386')
    244234                break
    245235                default :
     
    282272                        //Also specify the compiler by hand
    283273                        targets=""
    284                         if(do_alltests) {
     274                        if( params.RunAllTests ) {
    285275                                targets="--with-target-hosts='host:debug,host:nodebug'"
    286276                        } else {
     
    288278                        }
    289279
    290                         sh "${srcdir}/configure CXX=${compiler.cpp_cc} ${architecture} ${targets} --with-backend-compiler=${compiler.cfa_cc} --quiet"
     280                        sh "${srcdir}/configure CXX=${params.Compiler.cpp_cc} ${params.Architecture.flags} ${targets} --with-backend-compiler=${params.Compiler.cfa_cc} --quiet"
    291281
    292282                        //Compile the project
     
    301291                dir (builddir) {
    302292                        //Run the tests from the tests directory
    303                         if ( do_alltests ) {
     293                        if ( params.RunAllTests ) {
    304294                                sh 'make --no-print-directory -C tests all-tests debug=yes'
    305295                                sh 'make --no-print-directory -C tests all-tests debug=no '
     
    315305        build_stage('Benchmark') {
    316306
    317                 if( !do_benchmark ) return
     307                if( !params.RunBenchmark ) return
    318308
    319309                dir (builddir) {
    320310                        //Append bench results
    321                         sh "make --no-print-directory -C benchmark jenkins githash=${gitRefNewValue} arch=${arch_name} | tee ${srcdir}/bench.json"
     311                        sh "make --no-print-directory -C benchmark jenkins githash=${gitRefNewValue} arch=${params.Architecture} | tee ${srcdir}/bench.json"
    322312                }
    323313        }
     
    327317        build_stage('Documentation') {
    328318
    329                 if( !do_doc ) return
     319                if( !params.BuildDocumentation ) return
    330320
    331321                dir ('doc/user') {
     
    342332        build_stage('Publish') {
    343333
    344                 if( !do_publish ) return
     334                if( !params.Publish ) return
    345335
    346336                //Then publish the results
Note: See TracChangeset for help on using the changeset viewer.