Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add Firtool versions table to Versioning page #3694

Merged
merged 1 commit into from Dec 19, 2023

Conversation

jackkoenig
Copy link
Contributor

Fixes #3669

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Documentation or website-related

Desired Merge Strategy

  • Squash

Release Notes

This table is generated for all versions of Chisel that include BuildInfo.firtoolVersion and will thus automatically include new releases. Versions of Chisel that predate BuildInfo.firtoolVersion are included in the table manually.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.5.x, 3.6.x, or 5.x depending on impact, API modification or big change: 6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@jackkoenig jackkoenig added the Documentation Only changing documentation label Dec 19, 2023
Comment on lines +463 to +481
.settings(
firtoolVersionsTableTask / fileInputs ++= {
val rootGlob = (root / baseDirectory).value.toGlob
Seq(rootGlob / "build.sbt", rootGlob / "project" / "*.sbt", rootGlob / "project" / "*.scala")
},
firtoolVersionsTableTask := {
val logger = streams.value.log
val file = (Compile / sourceManaged).value / "FirtoolVersionsTable.scala"
// Only write the file if an input has changed
if (!file.exists || firtoolVersionsTableTask.inputFileChanges.hasChanges) {
// Escaping newlines makes it easier to generate the file
val table = FirtoolVersionsTable.generateTable.replaceAll("\n", "\\\\n")
logger.info(s"Writing $file...")
IO.write(file, s"""object FirtoolVersionsTable { def table = "$table" }""")
}
Seq(file)
},
Compile / sourceGenerators += firtoolVersionsTableTask.taskValue
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also illustrates how to generate files in SBT and have it properly track dependencies, was a bit frustrating to figure out but not bad once you have it working.

@jackkoenig jackkoenig merged commit 7c9d3b5 into main Dec 19, 2023
14 checks passed
@jackkoenig jackkoenig deleted the firtool-versions-table branch December 19, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Only changing documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation on firtool setup
1 participant