sbt-ghpages
sbt-ghpages copied to clipboard
Multiproject - "fatal: Not a git repository (or any of the parent directories): .git"
The Problems
I have a multiproject that I am struggling to make work with sbt-ghpages
and SBT 0.13.16. The subprojects are called root
and demo
, in similarly named directories. I would like to be able to generate Scaladoc for each of the subprojects, and push them both to gh-pages
somehow.
-
The first problem manifests in the
multi
git branch:$ sbt .. lots of output ... Reference to undefined setting: web3j-scala/*:gitRemoteRepo from web3j-scala/*:ghpagesUpdatedRepository ((com.typesafe.sbt.sbtghpages.GhpagesPlugin) GhpagesPlugin.scala:36)
This problem was reported September 8, 2015 in sbt/sbt-git#97, and the solution suggested by @wpc009 on Mar 14, 2016 can be rewritten for SBT 0.13.16+ as:
GitKeys.gitReader in ThisProject := baseDirectory(base => new DefaultReadableGit(base)).value,
However, adding that line into common settings does nothing.
BTW, the
root
project in themaster
git branch is not in a subdirectory, so the above problem does not manifest for that git branch. However,ghpagesPushSite
does not work for thedemo
sbt subproject in that branch for the same reason: the.git
directory is a sibling of thedemo
directory, instead of the.git
directory being a child of thedemo
directory. -
The second problem: Given N different subprojects, each of which might want to publish its own Scaladoc, I can image two ways of structuring the Scaladoc; are either of these options possible? a. N different git branches would hold the generated Scaladoc for each of the N sbt subprojects; the branches might be named after the sbt subprojects b. N different subdirectories would be created in the
gh-pages
branch, under the usuallatest/api/
directory; the subdirectories might be named after the sbt subprojects. For example:http://mslinn.github.io/web3j-scala/latest/api/project1name/index.html http://mslinn.github.io/web3j-scala/latest/api/project2name/index.html http://mslinn.github.io/web3j-scala/latest/api/project3name/index.html http://mslinn.github.io/web3j-scala/latest/api/project4name/index.html
What is the recommended way forward?
The solution(s) to both of these questions/problems should probably be added to the README for this project.
I am having the same issue, following the docs leads me to the same error. Is there a way to fix this?