<NME> build.gradle
<BEF> // top level build file where you can add configuration options common to all modules

defaultTasks 'cgeoHelp'

apply plugin: 'com.github.ben-manes.versions'

buildscript {

tasks.register('cgeoHelp') {
    group = 'cgeo'
    description = 'Displays help for building cgeo.'
    doLast {
        println ''
        println 'These are some of the available commands for building cgeo.'
        println ''
        println 'cleaning all generated artifacts:'
        println '    gradlew clean'
        println ''
        println 'build:'
        println '    gradlew assembleDebug'
        println ''
    }
}

allprojects {
    repositories {
        jcenter()
    }
        all {
            resolutionStrategy {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint"
    }
}

// define globally used properties for all projects
ext {
	AndroidAnnotationsVersion = '3.3.2'
	RXJavaVersion = '1.0.14'
	RXAndroidVersion = '0.25.0'
	JacksonCoreVersion = '2.6.3'
	JacksonDatabindVersion = '2.6.3'
	JacksonAnnotationsVersion = '2.6.3'
	CommonsCollections4Version = '4.0'
	CommonsLang3Version = '3.4'
	CommonsIoVersion = '2.4'
	ButterKnifeVersion = '7.0.1'
}

task cgeoHelp << {
	println ''
	println 'These are some of the available commands for building cgeo.'
	println ''
	println 'cleaning all generated artifacts:'
	println '    gradlew clean'
	println ''
	println 'build:'
	println '    gradlew assembleDebug'
	println ''
	println 'install on connected device/emulator:'
	println '    gradlew installDebug'
	println ''
	println 'test on connected device/emulator:'
	println '    gradlew connectedDebugAndroidTest'
	println ''
	println 'check project dependencies for updates:'
	println '    gradlew dependencies main:dependencies'
	println ''
	println 'check gradle dependencies for updates:'
	println '    gradlew dependencyUpdates'
	println ''
	println 'Use "gradlew tasks" for more available tasks.'
	
	// for CI? :
	// gradlew deviceCheck
	// gradlew connectedCheck
}
                    }
                }
                // new versions of checkstyle use guava 27, which has troublesome dependencies: https://groups.google.com/forum/#!topic/guava-announce/Km82fZG68Sw
                force 'com.google.guava:guava:26.0-jre'

                // force this version because of conflict to our resolutionStrategy from lint-gradle
                // TODO check necessity after every gradle update (gradlew :main:lintBasicDebug)
                force 'com.android.tools.build:aapt2-proto:4.2.2-7147631'
            }
        }
    }
}

/*
 * common configuration for the Java projects
 */
subprojects {
    repositories {
        mavenCentral()
        // Android Support libraries are now in an online Maven repository
        google()
        // integrate as last one - for versions by commit ID
        maven {
            url 'https://jitpack.io'
        }
    }

    // disable warning of annotation processor about annotation types with no registered processor (like @NonNull)
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:-processing"
    }

    idea.module {
        downloadJavadoc = true
        downloadSources = true
    }
}

/*
 * Make sure that we use the source distribution when updating the wrapper from the command line.
 */
tasks.named('wrapper') {
    distributionType = Wrapper.DistributionType.ALL
}

/*
 * Configuration for dependencyUpdates, see https://github.com/ben-manes/gradle-versions-plugin
 */
tasks.named('dependencyUpdates') {
    checkForGradleUpdate = true
    revision = "release"
    gradleReleaseChannel = "current"
    outputFormatter = "plain, html"
}

<MSG> restructure main build file, move properties to subproject configs
<DFF> @@ -1,7 +1,42 @@
-// top level build file where you can add configuration options common to all modules
-
+/*
+ * Just run this script using "gradlew", and it will show you typical examples of how to use it.
+ */
+ 
 defaultTasks 'cgeoHelp'
 
+task cgeoHelp << {
+	println ''
+	println 'These are some of the available commands for building cgeo.'
+	println ''
+	println 'cleaning all generated artifacts:'
+	println '    gradlew clean'
+	println ''
+	println 'build:'
+	println '    gradlew assembleDebug'
+	println ''
+	println 'install on connected device/emulator:'
+	println '    gradlew installDebug'
+	println ''
+	println 'test on connected device/emulator:'
+	println '    gradlew connectedDebugAndroidTest'
+	println ''
+	println 'check project dependencies for updates:'
+	println '    gradlew dependencies main:dependencies'
+	println ''
+	println 'check gradle dependencies for updates:'
+	println '    gradlew dependencyUpdates'
+	println ''
+	println 'Use "gradlew tasks" for more available tasks.'
+	
+	// for CI? :
+	// gradlew deviceCheck
+	// gradlew connectedCheck
+}
+
+
+/*
+ * update check for all components in this gradle script
+ */
 apply plugin: 'com.github.ben-manes.versions'
 
 buildscript {
@@ -22,7 +57,32 @@ buildscript {
     }
 }
 
+// filter out non release version updates
 allprojects {
+	configurations {
+		all {
+			resolutionStrategy {
+				componentSelection {
+					all { ComponentSelection selection ->
+						boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
+							selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
+						}
+						if (rejected) {
+							selection.reject('Release candidate')
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+
+/*
+ * common configuration for the Java projects
+ */
+ 
+subprojects {
     repositories {
         jcenter()
     }
@@ -31,47 +91,18 @@ allprojects {
     tasks.withType(JavaCompile) {
         options.compilerArgs << "-Xlint"
     }
-}
-
-// define globally used properties for all projects
-ext {
-	AndroidAnnotationsVersion = '3.3.2'
-	RXJavaVersion = '1.0.14'
-	RXAndroidVersion = '0.25.0'
-	JacksonCoreVersion = '2.6.3'
-	JacksonDatabindVersion = '2.6.3'
-	JacksonAnnotationsVersion = '2.6.3'
-	CommonsCollections4Version = '4.0'
-	CommonsLang3Version = '3.4'
-	CommonsIoVersion = '2.4'
-	ButterKnifeVersion = '7.0.1'
-}
 
-task cgeoHelp << {
-	println ''
-	println 'These are some of the available commands for building cgeo.'
-	println ''
-	println 'cleaning all generated artifacts:'
-	println '    gradlew clean'
-	println ''
-	println 'build:'
-	println '    gradlew assembleDebug'
-	println ''
-	println 'install on connected device/emulator:'
-	println '    gradlew installDebug'
-	println ''
-	println 'test on connected device/emulator:'
-	println '    gradlew connectedDebugAndroidTest'
-	println ''
-	println 'check project dependencies for updates:'
-	println '    gradlew dependencies main:dependencies'
-	println ''
-	println 'check gradle dependencies for updates:'
-	println '    gradlew dependencyUpdates'
-	println ''
-	println 'Use "gradlew tasks" for more available tasks.'
-	
-	// for CI? :
-	// gradlew deviceCheck
-	// gradlew connectedCheck
+	// define globally used properties for all projects
+	ext {
+		AndroidAnnotationsVersion = '3.3.2'
+		RXJavaVersion = '1.0.14'
+		RXAndroidVersion = '0.25.0'
+		JacksonCoreVersion = '2.6.3'
+		JacksonDatabindVersion = '2.6.3'
+		JacksonAnnotationsVersion = '2.6.3'
+		CommonsCollections4Version = '4.0'
+		CommonsLang3Version = '3.4'
+		CommonsIoVersion = '2.4'
+		ButterKnifeVersion = '7.0.1'
+	}
 }
\ No newline at end of file

restructure main build file, move properties to subproject configs