plugins { // The scalastyle plugin of smack-repl wants the root project to // have a ideaProject task, so let's add one. id 'idea' id 'org.igniterealtime.smack.javadoc-conventions' } ext { javadocAllDir = new File(buildDir, 'javadoc') integrationTestProjects = [ ':smack-integration-test', ':smack-omemo-signal-integration-test', ].collect{ project(it) } javadocAllProjects = subprojects - integrationTestProjects } evaluationDependsOnChildren() task javadocAll(type: Javadoc) { source javadocAllProjects.collect {project -> project.sourceSets.main.allJava.findAll { // Filter out symbolic links to avoid // "warning: a package-info.java file has already been seen for package" // javadoc warnings. !java.nio.file.Files.isSymbolicLink(it.toPath()) } } destinationDir = javadocAllDir // Might need a classpath classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath}) classpath += files(androidBootClasspath) def staticJxmppVersion = getResolvedVersion('org.jxmpp:jxmpp-core') def staticMiniDnsVersion = getResolvedVersion('org.minidns:minidns-core') options { linkSource = true use = true links = [ "https://docs.oracle.com/en/java/javase/${javaMajor}/docs/api/", "https://jxmpp.org/releases/${staticJxmppVersion}/javadoc/", "https://minidns.org/releases/${staticMiniDnsVersion}/javadoc/", ] as String[] overview = "$projectDir/resources/javadoc-overview.html" } // Finally copy the javadoc doc-files from the subprojects, which // are potentially generated, to the javadocAll directory. Note // that we use a copy *method* and not a *task* because the inputs // of copy tasks is determined within the configuration phase. And // since some of the inputs are generated, they will not get // picked up if we used a copy method. See also // https://stackoverflow.com/a/40518516/194894 doLast { copy { javadocAllProjects.each { from ("${it.projectDir}/src/javadoc") { include '**/doc-files/*.*' } } into javadocAllDir } } } task integrationTest { description 'Verify correct functionality of Smack by running some integration tests.' dependsOn project(':smack-integration-test').tasks.run } task omemoSignalIntTest { description 'Run integration tests of the smack-omemo module in combination with smack-omemo-signal.' dependsOn 'smack-omemo-signal-integration-test:run' } task sinttestAll { description 'Run all of Smack\'s integration tests.' dependsOn {[ integrationTest, omemoSignalIntTest, ]} } def getResolvedVersion(queriedProject = 'smack-core', component) { def configuration = project(queriedProject) .configurations .compileClasspath def artifact = configuration .resolvedConfiguration .resolvedArtifacts .findAll { // 'it' is of type ResolvedArtifact, 'id' of // Component*Artifact*Identifier, and we check the // ComponentIdentifier. it.id.getComponentIdentifier() instanceof org.gradle.api.artifacts.component.ModuleComponentIdentifier } .find { it.id.getComponentIdentifier().toString().startsWith(component + ':') } artifact.getModuleVersion().getId().getVersion() }