logo
Tags down

shadow

Can't configure properties-file in gradle


By : kbucklin
Date : September 15 2020, 10:00 PM
fixed the issue. Will look into that further BuildConfig is a class generated by the Android Gradle plugin, hence it's not part of the Gradle's standard featrue set.
code :


Share : facebook icon twitter icon

How configure multiple gradle.properties files in Gradle for multiple projects?


By : user3729546
Date : March 29 2020, 07:55 AM
I hope this helps . From my tests:
I have created blank root project without specifying which java to use and included two subprojects with different org.gradle.java.home and sourceCompatibility and targetCompatibility for each subproject and it works.
code :
/build.gradle <-- root project (no sourceCompatibility or targetCompatibility here .. just blank)
/settings.gradle <-- include the subprojects
/gradle.properties <-- root gradle.properties (no org.gradle.java.home here)
  /sub1/build.gradle
  /sub1/gradle.properties
  /sub2/build.gradle
  /sub2/gradle.properties
include 'sub1'
include 'sub2'
org.gradle.java.home=/path/to/java8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
org.gradle.java.home=/path/to/java7
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

Gradle Custom Plugin: How To Configure A Gradle Task Using Properties Expected to be Set in the Build Script


By : Kris Matrix
Date : March 29 2020, 07:55 AM
wish of those help I'm trying to write a custom Gradle plugin and I need to configure a 'Zip' task on my project using properties the values of which I'm expecting to be provided by the build script (build.gradle). , The solution I went with is:
code :
class Oozie implements Plugin<Project> {

  static final String DEFAULT_FILE_EXTENSION_FINDER_REGEX = /\.[^\.]+$/
  static final String DEFAULT_EXTENSION_REPLACEMENT = '.xml'
  final static DEFAULT_WORKFLOW_ROOT = 'workflow'
  final static DEFAULT_COORDINATOR_ROOT = 'coordinator'
  final static DEFAULT_DSL_DIR = 'dsl'
  final static DEFAULT_RESOURCE_DIR = 'resources'

  @Override
  void apply(Project project) {

    project.configurations {
      oozieLibs {
        description = /Java libraries (jars) to be downloaded and included in the workflow 'lib' directory/
        transitive = true
      }
    }

    project.extensions.create('oozie',
        OozieExtension,
        project.container(OozieSourceSet)
    )

    project.oozie.sourceSets {
      workflow {
        dslCopySpec = {
          from("${DEFAULT_WORKFLOW_ROOT}/${DEFAULT_DSL_DIR}") {
            rename { it - ~DEFAULT_FILE_EXTENSION_FINDER_REGEX + DEFAULT_EXTENSION_REPLACEMENT }
            filter(OozieWorkflowDslFilter)
          }
        }
        resourceCopySpec = {
          from("${DEFAULT_WORKFLOW_ROOT}/${DEFAULT_RESOURCE_DIR}")
        }
      }
      coordinator {
        dslCopySpec = {
          from("${DEFAULT_COORDINATOR_ROOT}/${DEFAULT_DSL_DIR}") {
            rename { it - ~DEFAULT_FILE_EXTENSION_FINDER_REGEX + DEFAULT_EXTENSION_REPLACEMENT }
            filter(OozieWorkflowDslFilter)
          }
        }
        resourceCopySpec = {
          from("${DEFAULT_COORDINATOR_ROOT}/${DEFAULT_RESOURCE_DIR}")
        }
      }
    }

    project.task('build', type: Zip) {
      group = 'Oozie Workflow Build'
      with {
        archiveName = "${project.name}-${project.version}.${extension}"
        destinationDir = project.buildDir
      }
    }

    project.task('clean', type: Delete) {
      group = 'Oozie Workflow Build'
      delete project.buildDir
    }

    project.afterEvaluate {
      project.build.with {
        from(project.configurations.oozieLibs) {
          into 'lib'
        }
      }

      project.oozie.sourceSets.each { OozieSourceSet sourceSet ->
        project.build.with(sourceSet.dslCopySpec)
        project.build.with(sourceSet.resourceCopySpec)
      }
    }
  }

}

Configure gradle.properties android.enableAapt=false on travis yml file


By : Ramin Safari
Date : March 29 2020, 07:55 AM
hop of those help? I think the problem is that you are disabling AAPT2 in global properties file ~/.gradle/gradle.properties instead of project properties file /yourproject/gradle.properties.

Some light on gradle.properties, settings.gradle, gradle-wrapper.properties and local.properties


By : Mukhammedali
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , gradle.properties
Using gradle.properties to create universal variables This solution is limited to Android projects as far as I know. In /gradle.properties you can define your universal or project level variables as such: Link
code :
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Aug 14 14:49:26 PDT 2014
sdk.dir=C\:\\Program Files (x86)\\Android\\android-studio\\sdk

configure catalina.properties gradle project


By : Lee Wissmiller
Date : March 29 2020, 07:55 AM
this will help It's not clear if you are using gradle-tomcat plugin or not, but if you are: you could create a task that copy the catalina.propetiesconfig file to the temporary Tomcat directory, and make the tomcatRun depends on this task. The catalina.properties file could be stored in your project resources , e.g.: in src/main/conf
code :
ext{
    // path to catalina.properties in your project
    catalinaPropertiesPath = 'src/main/conf/catalina.properties'

    // path to temporary directory used by gradle-tomcat plugin
    tomcatTmpRunDir = "$buildDir/tmp/tomcatRun/conf"
}

// copy catalina.properties conf file
task copyCatalinaProperties(type: Copy){
    from( catalinaPropertiesPath)
    into(tomcatTmpRunDir)

}

// create task dependency
tomcatRun.dependsOn copyCatalinaProperties
Related Posts Related Posts :
shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk