diff --git a/build.gradle b/build.gradle index ca02d253e9..0885f50b6b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,27 +5,31 @@ buildscript { repositories { google() mavenCentral() - maven { - url "https://oss.sonatype.org/content/repositories/snapshots" - } gradlePluginPortal() } dependencies { - classpath "com.android.tools.build:gradle:${ANDROID_GRADLE_VERSION}" + classpath "com.android.tools.build:gradle:$ANDROID_GRADLE_VERSION" if (!hasProperty('DISABLE_ERROR_PRONE')) { - classpath "net.ltgt.gradle:gradle-errorprone-plugin:${ERROR_PRONE_PLUGIN_VERSION}" + classpath "net.ltgt.gradle:gradle-errorprone-plugin:$ERROR_PRONE_PLUGIN_VERSION" } classpath 'com.guardsquare:proguard-gradle:7.1.0' - classpath "se.bjurr.violations:violations-gradle-plugin:${VIOLATIONS_PLUGIN_VERSION}" - classpath "androidx.benchmark:benchmark-gradle-plugin:${ANDROID_X_BENCHMARK_VERSION}" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${JETBRAINS_KOTLIN_VERSION}" + classpath "se.bjurr.violations:violations-gradle-plugin:$VIOLATIONS_PLUGIN_VERSION" + classpath "androidx.benchmark:benchmark-gradle-plugin:$ANDROID_X_BENCHMARK_VERSION" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$JETBRAINS_KOTLIN_VERSION" classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:$KSP_GRADLE_PLUGIN_VERSION" - classpath "org.jetbrains.kotlinx:binary-compatibility-validator:0.11.0" + classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$JETBRAINS_KOTLINX_BINARY_COMPATIBILITY_VALIDATOR_VERSION" + classpath "org.jetbrains.dokka:dokka-gradle-plugin:$JETBRAINS_DOKKA_VERSION" } } +repositories { + google() + mavenCentral() +} + apply plugin: 'binary-compatibility-validator' +apply plugin: 'org.jetbrains.dokka' apiValidation { ignoredProjects += ["ksp", "test", "gallery"] @@ -41,8 +45,23 @@ if (JavaVersion.current().isJava8Compatible()) { } } -subprojects { project -> +dokkaHtmlMultiModule.configure { + moduleName.set("Glide") +} +afterEvaluate { + tasks.named("dokkaHtmlMultiModule") { + pluginsMapConfiguration.set( + [ + "org.jetbrains.dokka.base.DokkaBase": """{ + "customStyleSheets": ["${projectDir.toString()}/static/logo-styles.css"], + "customAssets" : ["${projectDir.toString()}/static/logo-icon.svg", "${projectDir.toString()}/static/glide_circle_logo.png"] + }""" + ] + ) + } +} +subprojects { project -> repositories { google() mavenCentral() @@ -61,6 +80,45 @@ subprojects { project -> } } + // Exclude packages not intended for public use. + if (![ + "testutil", + "flickr", + "giphy", + "imgur", + "svg", + "gallery", + "contacturi", + "test", + "gif_decoder", + "gifencoder", + "compiler", + "benchmark", + "instrumentation" + ].contains(project.getName())) { + afterEvaluate { + project.apply plugin: 'org.jetbrains.dokka' + + project.tasks.dokkaHtmlPartial.configure { + dokkaSourceSets { + // Kotlin works out of the box + if (!project.plugins.hasPlugin("kotlin-android") && project.plugins.hasPlugin("com.android.library")) { + // Java Android modules + register("main") { + sourceRoots.from(project.android.sourceSets.main.java.srcDirs) + + } + } else if (project.plugins.hasPlugin("java") && "ksp" != project.getName()) { + // Java only modules (ksp is not useful and uses multiple plugins) + register("main") { + sourceRoots.from(sourceSets.main.java.srcDirs) + } + } + } + } + } + } + tasks.withType(JavaCompile) { // gifencoder is a legacy project that has a ton of warnings and is basically never // modified, so we're not going to worry about cleaning it up. diff --git a/gradle.properties b/gradle.properties index 4c8c2e7b8e..5aaa543099 100644 --- a/gradle.properties +++ b/gradle.properties @@ -71,6 +71,8 @@ JETBRAINS_KOTLINX_COROUTINES_VERSION=1.6.4 JETBRAINS_KOTLINX_COROUTINES_TEST_VERSION=1.6.4 JETBRAINS_KOTLIN_VERSION=1.7.0 JETBRAINS_KOTLIN_TEST_VERSION=1.7.0 +JETBRAINS_KOTLINX_BINARY_COMPATIBILITY_VALIDATOR_VERSION=0.11.0 +JETBRAINS_DOKKA_VERSION=1.7.10 ## Other dependency versions ACCOMPANIEST_VERSION=0.25.1 diff --git a/library/build.gradle b/library/build.gradle index 8bbc1c7ee4..846a10998a 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -69,6 +69,19 @@ android { } } +// Change the name to make it a little more obvious where the main library +// documentation has gone. Using a capital letter happens to make this first in +// the list too... +afterEvaluate { + dokkaHtmlPartial.configure { + dokkaSourceSets { + named("main") { + moduleName.set("Glide") + } + } + } +} + check.dependsOn(':library:pmd:pmd') check.dependsOn(':library:test:check') diff --git a/static/glide_circle_logo.png b/static/glide_circle_logo.png new file mode 100644 index 0000000000..3b6daa24cc Binary files /dev/null and b/static/glide_circle_logo.png differ diff --git a/static/logo-icon.svg b/static/logo-icon.svg new file mode 100644 index 0000000000..1f6e3761ac --- /dev/null +++ b/static/logo-icon.svg @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/static/logo-styles.css b/static/logo-styles.css new file mode 100644 index 0000000000..90520ba175 --- /dev/null +++ b/static/logo-styles.css @@ -0,0 +1,17 @@ +.library-name a { + position: relative; + --logo-width: 75px; + margin-left: calc(var(--logo-width) + 5px); +} + +.library-name a::before { + content: ''; + background: url("../images/glide_circle_logo.png") center no-repeat; + background-size: contain; + position: absolute; + width: var(--logo-width); + height: 50px; + top: -18px; + left: calc(-1 * var(--logo-width) - 5px); + /* other styles required to make your page pretty */ +} \ No newline at end of file