Changeset 4f6b58e for build.gradle


Ignore:
Timestamp:
Feb 17, 2019 2:35:26 AM (20 months ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
f9c1396
Parents:
2556c77
Message:

Gradle: Configure —release compiler flag after project evaluation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.gradle

    r2556c77 r4f6b58e  
    102102            throw new GradleException("Set java7BootClasspath property or JAVA7_HOME environment variable to enable cross-compilation, or run Gradle with JDK 9+")
    103103        }
    104         tasks.withType(JavaCompile) {
    105             def version = compat(sourceCompatibility)
    106             logger.info("Configuring $name to use --release $version")
    107             options.compilerArgs.addAll(['--release', version])
     104        project.afterEvaluate {
     105            tasks.withType(JavaCompile) {
     106                def version = compat(sourceCompatibility)
     107                logger.info("Configuring $name to use --release $version")
     108                options.compilerArgs.addAll(['--release', version])
     109            }
    108110        }
    109111    }
Note: See TracChangeset for help on using the changeset viewer.