Nuxt 3 SSR deploy on vercel via self hosted gitlab CI - deployment

Im trying to deploy nuxt 3 in SSR mode to vercel via self hosted gitlab CI without luck. I follow official vercel example (https://github.com/vercel/examples/tree/main/ci-cd/gitlab-cicd). So in general deploy run these commands:
npm install --global vercel
vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
vercel build --token=$VERCEL_TOKEN
vercel deploy --prebuilt --token=$VERCEL_TOKEN
After everything was set I tried to actually run it and most of process seems ok
$ npm install --global vercel
added 214 packages, and audited 215 packages in 43s
26 packages are looking for funding
run `npm fund` for details
4 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
$ vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
Vercel CLI 28.2.5
Retrieving project…
> Downloading `preview` Environment Variables for Project XXX
Downloading
Created .vercel/.env.preview.local file [564ms]
> Downloading project settings
Downloaded project settings to .vercel/project.json [0ms]
$ vercel build --token=$VERCEL_TOKEN
Vercel CLI 28.2.5
Installing dependencies...
> postinstall
> nuxt prepare
[log] Nuxi 3.0.0-rc.10
[info] [nuxt:tailwindcss] Using default Tailwind CSS file from runtime/tailwind.css
[success] Types generated in .nuxt
added 761 packages in 41s
105 packages are looking for funding
run `npm fund` for details
> build
> nuxt build
[log] Nuxi 3.0.0-rc.10
[log] Nuxt 3.0.0-rc.10 with Nitro 0.5.3
[info] [nuxt:tailwindcss] Using default Tailwind CSS file from runtime/tailwind.css
[warn]
[warn] warn - No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
[warn] warn - https://tailwindcss.com/docs/content-configuration
[info] Client built in 5509ms
[info] Building server...
[success] Server built in 2822ms
[success] [nitro] Generated public .output/public
[info] [nitro] Building Nitro Server (preset: `node-server`)
[success] [nitro] Nitro server built
├─ .output/server/package.json (650 B) (287 B gzip)
├─ .output/server/index.mjs (458 B) (257 B gzip)
├─ .output/server/chunks/nitro/node-server.mjs.map (62.8 kB) (4.78 kB gzip)
├─ .output/server/chunks/nitro/node-server.mjs (18.6 kB) (5.87 kB gzip)
├─ .output/server/chunks/handlers/renderer.mjs.map (19.6 kB) (3.39 kB gzip)
├─ .output/server/chunks/handlers/renderer.mjs (15.5 kB) (4.75 kB gzip)
├─ .output/server/chunks/error-500.mjs.map (1.05 kB) (379 B gzip)
├─ .output/server/chunks/error-500.mjs (4.26 kB) (1.83 kB gzip)
├─ .output/server/chunks/app/styles.mjs.map (538 B) (279 B gzip)
├─ .output/server/chunks/app/styles.mjs (5.54 kB) (1.57 kB gzip)
├─ .output/server/chunks/app/server.mjs.map (55.4 kB) (8.16 kB gzip)
├─ .output/server/chunks/app/server.mjs (43.7 kB) (11.2 kB gzip)
├─ .output/server/chunks/app/client.manifest.mjs.map (2.38 kB) (495 B gzip)
├─ .output/server/chunks/app/client.manifest.mjs (3.21 kB) (589 B gzip)
├─ .output/server/chunks/app/_nuxt/index.fcab534d.mjs.map (756 B) (367 B gzip)
├─ .output/server/chunks/app/_nuxt/index.fcab534d.mjs (1.12 kB) (532 B gzip)
├─ .output/server/chunks/app/_nuxt/error-component.5ae4281e.mjs.map (2.34 kB) (801 B gzip)
├─ .output/server/chunks/app/_nuxt/error-component.5ae4281e.mjs (2.01 kB) (894 B gzip)
├─ .output/server/chunks/app/_nuxt/error-500.1731c24b.mjs.map (1.69 kB) (612 B gzip)
├─ .output/server/chunks/app/_nuxt/error-500.1731c24b.mjs (3.17 kB) (1.41 kB gzip)
├─ .output/server/chunks/app/_nuxt/error-500-styles.ad145178.mjs.map (350 B) (222 B gzip)
├─ .output/server/chunks/app/_nuxt/error-500-styles.ad145178.mjs (2.22 kB) (864 B gzip)
├─ .output/server/chunks/app/_nuxt/error-404.2013b5e2.mjs.map (2.35 kB) (798 B gzip)
├─ .output/server/chunks/app/_nuxt/error-404.2013b5e2.mjs (4.03 kB) (1.7 kB gzip)
├─ .output/server/chunks/app/_nuxt/error-404-styles.3db9fdd2.mjs.map (350 B) (223 B gzip)
├─ .output/server/chunks/app/_nuxt/error-404-styles.3db9fdd2.mjs (3.92 kB) (1.25 kB gzip)
├─ .output/server/chunks/app/_nuxt/default.a6850ccd.mjs.map (929 B) (424 B gzip)
└─ .output/server/chunks/app/_nuxt/default.a6850ccd.mjs (1.31 kB) (612 B gzip)
Σ Total size: 3.05 MB (705 kB gzip)
[success] [nitro] You can preview this build using `node .output/server/index.mjs`
Error: No Output Directory named "dist" found after the Build completed. You can configure the Output Directory in your Project Settings.
Learn More: https://vercel.link/missing-public-directory
So it seems that build itself and authentification is ok but the problem is:
Error: No Output Directory named "dist" found after the Build completed. You can configure the Output Directory in your Project Settings.
On first sight it seems like vercel expect generated site and not SSR. I tried to google little bit and I have found vercel-builder which seems to solve this problem (at least for nuxt https://github.com/nuxt/vercel-builder) but i got errors with type script which actually lead me to https://github.com/nuxt/vercel-builder/issues/245 where is info that it should not be used for nuxt 3. To be more specific:
Don't use this with Nuxt 3 - there is a much better, built-in solution for deploying to Vercel!
and link to
https://v3.nuxtjs.org/guide/deploy/providers/vercel
But from official nuxt 3 for vercel provider:
Support for serverless build
Auto-detected when deploying
No configuration required
It seems that it should somehow works out of the box. Weirdest thing is that if I use same commands that i use in gitlab CI from local terminal deploy is successful and everything is fine.
I would be glad for any advice. Im trying to solve this for hours.

override the build command in the project settings in vercel to use nuxt generate.

Related

Can't add images to a vscode Extension readme.md

The error
Every time I try to compile the extension with the images inside of the readme.md it returns the following error:
> vsce package
Executing prepublish script 'npm run vscode:prepublish'...
> waiter#0.0.1 vscode:prepublish D:\projetos\waiter
> npm run package
> waiter#0.0.1 package D:\projetos\waiter
> webpack --mode production --devtool hidden-source-map
[webpack-cli] Compiler starting... [webpack-cli] Compiler is using config: 'D:\projetos\waiter\webpack.config.js'
[webpack-cli] Compiler finished
asset extension.js 1.18 KiB [compared for emit] [minimized] (name: main) 1 related asset
./src/extension.ts 2.15 KiB [built] [code generated]
external "vscode" 42 bytes [built] [code generated]
webpack 5.62.2 compiled successfully in 1625 ms
ERROR Couldn't detect the repository where this extension is published. The image './readmeImages/initializing.gif' will be broken in README.md. GitHub/GitLab repositories will be automatically detected. Otherwise, please provide the repository URL in package.json or use the --baseContentUrl and --baseImagesUrl options.
It recomends me to run with --baseContentUrl and --baseImagesUrl
> vsce package --baseContentUrl --baseImageUrl
Executing prepublish script 'npm run vscode:prepublish'...
> waiter#0.0.1 vscode:prepublish D:\projetos\waiter
> npm run package
> waiter#0.0.1 package D:\projetos\waiter
> webpack --mode production --devtool hidden-source-map
[webpack-cli] Compiler starting...
[webpack-cli] Compiler is using config: 'D:\projetos\waiter\webpack.config.js'
[webpack-cli] Compiler finished
asset extension.js 1.18 KiB [compared for emit] [minimized] (name: main) 1 related asset
./src/extension.ts 2.15 KiB [built] [code generated]
external "vscode" 42 bytes [built] [code generated]
webpack 5.62.2 compiled successfully in 1628 ms
ERROR Invalid URL: --baseImageUrl/readmeImages/initializing.gif
Readme.md
## Features
The gif can show you what I'm talking about, you just open the folder and everything is setup for your development session
<img src="https://github.com/biel-correa/waiter/tree/master/readmeImages/initializing.gif?raw=true" alt="initializing a project">
## Requirements
The Waiter needs a JSON file so that he knows what you want, but don't worry as soon as it runs he'll ask you to create it.
<img src="https://github.com/biel-correa/waiter/blob/master/readmeImages/askingToCreate.png?raw=true" alt="how it asks to create">
view repository
I had to open the github markdown editor so that I could drag and drop the files I wanted to show, when you do like that github generates a custom path for the file.
My link
https://github.com/biel-correa/waiter/tree/master/readmeImages/initializing.gif
Generated link
https://user-images.githubusercontent.com/56176344/143320917-12fe3516-36af-4ec5-a073-5c2dd9abdc46.gif

Keeping Nuget packages updated in many projects/solutions

If using the same nuget package(s) over multiple solutions, how do I keep them up to date without having to open up every solution and update packages when a new version is released?
Folder structure is typically something like this but over many more projects. Each project has its own packages.config with various package references.
$tfs/
├── Solution One/
│ ├ Solution 1.sln
│ ├ nuget.config (solution item)
│ ├── Packages/
│ ├ ├── Newtonsoft.JSON.12.0.2/
│ ├ ├── Jquery3.1.4/
│ ├── Project one/
│ ├ ── packages.config
│ ├ ── whatever.cs
│ ├ ── folder /
│ ├ ── another folder /
│ ├── Project Two/
│ ├ ── packages.config
│ ├ ── file.cs
│ ├ ── folder/
│ ├ ── another folder/
├── Solution Two/
│ ├ Solution 2.sln
│ ├ nuget.config
│ ├── Packages/
│ ├ ├── Newtonsoft.JSON.11.1.0/
│ ├ ├── Jquery1.3.4/
│ ├── Project one/
│ ├ ── packages.config
│ ├ ── whatever.cs
│ ├ ── folder /
│ ├ ── another folder /
│ ├── Project two/
│ ├ ── packages.config
│ ├ ── file.cs
│ ├ ── folder/
│ ├ ── another folder/
I have tried running this powershell in Package Manager Console but this only applies to one solution at a time:
$packageId = "jquery"
Get-ChildItem *.sln -recurse | %{.\\nuget.exe restore $_.fullname}
Get-ChildItem packages.config -Recurse `
| Where-Object {$_ | Select-String -Pattern $packageId} `
| %{.\\nuget.exe update -Id $packageId $_.FullName}
Do I need to update packages.config in each solution of each project and open them in order to get the updates? I would have thought there would be an easier way to do this. I am using a private nuget server if it makes a difference.
Note: I have looked at this question: Updating nuget packages in all projects in a solution and it is not the same scenario as mine. I'm looking to update packages across multiple solutions, not multiple projects in one solution.
As #imps said in the comments, there's no solution for packages.config projects across solutions. Within a solution you can use the NuGet Package Manager UI's "Manage packages for solution" and the consolidate tab helps makes sure all projects use the same version, but you'll need to repeat this for all solutions.
If you migrate from packages.config to PackageReference, you could take advantage of MSBuild extensibility and either import a common props file, or if using Visual Studio 2017 or newer, use Directory.Build.Props in the highest common parent directory of all the projects.
In your props file, you define the versions of the packages you care about, something like this:
<Project>
<PropertyGroup>
<NewtonsoftJsonVersion>12.0.1</NewtonsoftJsonVersion>
</PropertyGroup>
</Project>
and then in your csproj files, use <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />. The issue with this is that you can no longer use the Package Manager UI or Package Manager Console in VS to upgrade (well you can, but it'll change it in the csproj, not your props file), but you can still use the UI to check for updates. If you add your props file to your solution, then it just takes two clicks and a few taps on your keyboard to update, so it's really not a big deal.
In your example, the common parent directory would be the TFS root, so $/Directory.Build.props. The problem with this is if you use CI and have a trigger to run the Solution One build on changes to $/Solution One/* and run the Solution Two build on changes to $/Solution Two/*, then they'll both miss changes to $/Directory.Build.props. Or maybe it is possible to configure TFS build triggers to include it, but I don't remember because I haven't used TFVC is such a long time.
However, the bigger issue is that in your example, it's clear you're using the jQuery package. This uses content, which copies files into your project on install/upgrade. PackageReference doesn't work this way (it's listed as a package compatibility issue) , so unless you want to have a different process for upgrading jQuery and any other js/css in your web projects, you can't migrate ASP.NET projects to PackageReference. Note that ASP.NET Core projects are SDK style which only support PackageReference, not packages.config, and typically use either LibMan or npm to get css and javascript.
Customers who can migrate to SDK style projects, they could even consider using this SDK for central package management that helps ensure you don't accidently leave a version number in your csproj.

Problem deploying to Zeit Now - Error: Build was unable to create the distDir: public

I've been trying to deploy a Gatsby.js blog with a Sanity.io back-end to Now. I started the project using this template (https://github.com/sanity-io/example-company-website-gatsby-sanity-combo), have written a few blog posts and attempted to deploy to Now. I'm hitting an error during deployment:
TaskID a56874b3-6d7f-4ecf-90d1-c5a05f3fe6ea
#zeit/now-dcs-info: using https://dcs.now.systems as the upstream
running yarn info for #now/build-utils...
running yarn info for #now/static-build...
running yarn for #now/build-utils...
yarn add v1.13.0
warning package.json: No license field
info No lockfile found.
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 35 new dependencies.
info Direct dependencies
└─ #now/build-utils#0.5.1
info All dependencies
├─ #now/build-utils#0.5.1
├─ async-retry#1.2.3
├─ async-sema#2.1.4
├─ balanced-match#1.0.0
├─ brace-expansion#1.1.11
├─ buffer-crc32#0.2.13
├─ concat-map#0.0.1
├─ core-util-is#1.0.2
├─ double-ended-queue#2.1.0-0
├─ end-of-stream#1.4.1
├─ errno#0.1.7
├─ from2#2.3.0
├─ fs-extra#7.0.0
├─ fs.realpath#1.0.0
├─ glob#7.1.3
├─ graceful-fs#4.1.15
├─ inflight#1.0.6
├─ into-stream#5.0.0
├─ isarray#1.0.0
├─ jsonfile#4.0.0
├─ memory-fs#0.4.1
├─ minimatch#3.0.4
├─ multistream#2.1.1
├─ node-fetch#2.2.0
├─ p-is-promise#2.1.0
├─ path-is-absolute#1.0.1
├─ process-nextick-args#2.0.0
├─ prr#1.0.1
├─ readable-stream#2.3.6
├─ retry#0.12.0
├─ safe-buffer#5.1.2
├─ string_decoder#1.1.1
├─ universalify#0.1.2
├─ util-deprecate#1.0.2
└─ yazl#2.4.3
Done in 1.42s.
running yarn for #now/static-build...
yarn add v1.13.0
warning package.json: No license field
info No lockfile found.
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 4 new dependencies.
info Direct dependencies
└─ #now/static-build#0.5.2
info All dependencies
├─ #now/static-build#0.5.2
├─ get-port#5.0.0
├─ promise-timeout#1.3.0
└─ type-fest#0.3.1
Done in 0.67s.
running builder.exports.build...
downloading user files...
installing to /tmp/2b1d07e4/web
running user "now-build" script from `package.json`...
running "npm run now-build"
> example-company-website-gatsby-sanity-combo-frontend#1.0.0 now-build /tmp/2b1d07e4/web
> npm run build
> example-company-website-gatsby-sanity-combo-frontend#1.0.0 build /tmp/2b1d07e4/web
> gatsby build
success open and validate gatsby-configs — 0.011 s
success load plugins — 0.197 s
success onPreInit — 0.516 s
success delete html and css files from previous builds — 0.009 s
success initialize cache — 0.009 s
success copy gatsby files — 0.030 s
warning [sanity] `overlayDrafts` is set to `true`, but no token is given
warning [sanity] Using `watchMode` when not in develop mode might prevent your build from completing
info [sanity] Fetching remote GraphQL schema
info [sanity] Stitching GraphQL schemas from SDL
success onPreBootstrap — 0.398 s
info [sanity] Fetching export stream for dataset
info [sanity] Watch mode enabled, starting a listener
info [sanity] Done exporting!
success source and transform nodes — 0.271 s
success building schema — 1.450 s
info Creating blog post page: /blog/2019/05/coding-a-design-system-part-one/
info Creating blog post page: /blog/2019/05/coding-a-design-system-part-two/
info Creating project page: /project/barclays-design-language/
success createPages — 0.323 s
success createPagesStatefully — 0.055 s
success onPreExtractQueries — 0.016 s
success update schema — 1.154 s
success extract queries from components — 0.298 s
success run graphql queries — 0.162 s — 12/12 74.77 queries/second
success write out page data — 0.004 s
success write out redirect data — 0.001 s
success onPostBootstrap — 0.001 s
info bootstrap finished - 7.409 s
success Building production JavaScript and CSS bundles — 23.259 s
success Building static HTML for pages — 4.967 s — 10/10 30.18 pages/second
info Done building in 35.64 sec
Error: Build was unable to create the distDir: public.
Make sure you mentioned the correct dist directory: https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build/#configuring-the-build-output-directory
at validateDistDir (/tmp/utils/build-module/node_modules/#now/static-build/index.js:19:11)
at Object.exports.build (/tmp/utils/build-module/node_modules/#now/static-build/index.js:114:7)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
I think this might be a common issue from other posts I've read but I'm unsure on next steps. Has anyone successfully fixed a similar issue to this that could lend a hand? Thanks

Can I run sbt new with a local template (not GitHub)?

I work in a secure environment where developers are not allowed to git-clone from GitHub, or any other external repos.
I was able to download a g8 template (play-scala-seed) from GitHub as a zip file and I've unzipped it to a local folder. Can I use that local directory instead of a git repo?
My first attempt at this failed:
> dir .\play-scala-seed
Volume in drive C is OSDisk
Volume Serial Number is A074-A016
Directory of C:\workspace\play-scala-seed
03/22/2018 11:03 AM <DIR> .
03/22/2018 11:03 AM <DIR> ..
03/22/2018 11:01 AM <DIR> project
03/22/2018 10:57 AM <DIR> src
03/22/2018 11:03 AM <DIR> target
03/22/2018 10:57 AM 70 .gitignore
03/22/2018 10:57 AM 509 .travis.yml
03/22/2018 10:57 AM 453 build.sbt
03/22/2018 10:57 AM 439 LICENSE
03/22/2018 10:57 AM 1,166 README.md
5 File(s) 2,637 bytes
5 Dir(s) 220,172,980,224 bytes free
Even though I'm sure the template exists and in in a directory called "play-scala-seed", it's not accepted by the SBT new command:
> sbt new .\play-scala-seed
Template not found for: .\play-scala-seed
So how can I make sbt new use a local directory for a g8 template?
I'm running Windows (if that matters!)
When you use giter8 directly you just need to refer to your local template with the file:// prefix:
g8 file://play-scala-seed
As mentioned by #volia17, you can find it in the giter8 documentation: Testing templates locally.
But when you use sbt new, you need you template name (folder) to end with .g8. sbt can accept different types of templates and this way it knows that this is a giter8 template. So you can rename your template folder to play-scala-seed.g8:
sbt new file://play-scala-seed.g8
P.S. Using giter8 directly is much faster, because sbt new takes time to start (it loads global sbt plugins every time).

Generating single ScalaDoc for multiple sub-projects using Gradle

I'm using Gradle (v2.3) for a project, that contains multiple Scala sub-projects. Generating the ScalaDoc for each sub-project individually works as expected (running gradle :project-a:scaladoc or gradle :project-b:scaladoc).
But how do a get a single ScalaDoc of all Scala sub-projects? The minimal project below leads to a "Cannot invoke method withInputStream() on null object" error, when executing
gradle scaladoc --info:
Starting Build
Compiling settings file '/tmp/gradle-scaladoc-test/settings.gradle' using StatementExtractingScriptTransformer.
Compiling settings file '/tmp/gradle-scaladoc-test/settings.gradle' using BuildScriptTransformer.
Settings evaluated using settings file '/tmp/gradle-scaladoc-test/settings.gradle'.
Projects loaded. Root project using build file '/tmp/gradle-scaladoc-test/build.gradle'.
Included projects: [root project 'some project', project ':project-a', project ':project-b']
Evaluating root project 'some project' using build file '/tmp/gradle-scaladoc-test/build.gradle'.
Compiling build file '/tmp/gradle-scaladoc-test/build.gradle' using StatementExtractingScriptTransformer.
Compiling build file '/tmp/gradle-scaladoc-test/build.gradle' using BuildScriptTransformer.
Evaluating project ':project-a' using empty build file.
Evaluating project ':project-b' using empty build file.
All projects evaluated.
Selected primary task 'scaladoc' from project :
Tasks to be executed: [task ':scaladoc', task ':project-a:compileJava', task ':project-a:compileScala', task ':project-a:processResources', task ':project-a:classes', task ':project-a:scaladoc', task ':project-b:compileJava', task ':project-b:compileScala', task ':project-b:processResources', task ':project-b:classes', task ':project-b:scaladoc']
:scaladoc (Thread[main,5,main]) started.
:scaladoc
Executing task ':scaladoc' (up-to-date check took 0.448 secs) due to:
No history is available.
:scaladoc FAILED
:scaladoc (Thread[main,5,main]) completed. Took 0.768 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':scaladoc'.
> Cannot invoke method withInputStream() on null object
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 5.198 secs
Stopped 0 compiler daemon(s).
Directory structure:
├─ project-a/
│   └─ src/
│   └─ main/
│   └─ scala/
│   └─ package_a/
│   └─ A.scala
├─ project-b/
│   └─ src/
│   └─ main/
│   └─ scala/
│   └─ package_b/
│   └─ B.scala
├─ build.gradle
└─ settings.gradle
build.gradle
subprojects {
repositories {
mavenCentral()
}
apply plugin: 'scala'
dependencies {
compile 'org.scala-lang:scala-library:2.11.6'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ['-unchecked', '-deprecation', '-feature']
scalaCompileOptions.useAnt = false
}
}
task scaladoc(type: org.gradle.api.tasks.scala.ScalaDoc) {
group = 'Documentation'
description = 'Aggregated ScalaDoc documentation.'
title = 'Title of documentation'
destinationDir = new File(buildDir, "aggregated-api")
source subprojects.collect { project ->
project.sourceSets.main.allScala
}
scalaClasspath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
settings.gradle
rootProject.name = 'some project'
include 'project-a', 'project-b'
A.scala
package package_a
case class A(value: Int)
B.scala
package package_b
case class B(value: Int)
The only similar problem I could find is "Gradle Fails to Compile Basic Scala Project", but it doesn't help here (and is about Gradle 1.3).
I know it's been a while since this has been asked, but since I just had the exact same problem...
I solved it the following way:
task aggregatedScaladocs(type: ScalaDoc, description: 'Generate scaladocs from all child projects as if it were a single project', group: 'Documentation') {
destinationDir = file("$buildDir/docs/scaladoc")
title = "$project.name $version API"
subprojects.each { proj ->
proj.tasks.withType(ScalaDoc).each {
source += proj.sourceSets.main.allJava
source += proj.sourceSets.main.allScala
classpath += proj.sourceSets.main.compileClasspath
excludes += scaladoc.excludes
includes += scaladoc.includes
}
}
}
Hope it'll help somebody at some point.
For Gradle 6.x I needed to use slightly modified version of answer by #juwi.
task aggregatedScaladocs(type: ScalaDoc, description: 'Generate scaladocs from all child projects as if it were a single project', group: 'Documentation') {
destinationDir = file("$buildDir/docs/scaladoc")
title = "$project.name $version API"
classpath = project.files([])
scalaClasspath = project.files([])
subprojects.each { proj ->
proj.tasks.withType(ScalaDoc).each {
source proj.sourceSets.main.allJava
source proj.sourceSets.main.allScala
classpath += proj.scaladoc.classpath
scalaClasspath += proj.scaladoc.scalaClasspath
exclude proj.scaladoc.excludes
include proj.scaladoc.includes
}
}
}