Skip to content

Commit

Permalink
Merge 8a55d31 into be89ace
Browse files Browse the repository at this point in the history
  • Loading branch information
reid-spencer committed Nov 13, 2022
2 parents be89ace + 8a55d31 commit 7b93146
Show file tree
Hide file tree
Showing 24 changed files with 741 additions and 437 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Scala CI
name: Scala Build

on:
push:
Expand All @@ -24,10 +24,14 @@ jobs:
extended: true
- name: Coursier Caching
uses: coursier/cache-action@v6
- name: Build, Run Tests, Generate Packages
- name: Build, Run Test, Coverage
run: |
which hugo
sbt -v clean Test/compile test
sbt -v clean coverage Test/compile test coverageAggregate coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: Scala ${{ matrix.scala }}

- name: Cleanup Before Caching
shell: bash
run: |
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
![Code Build Status](https://github.com/reactific/riddl/actions/workflows/scala.yml/badge.svg)
![Documentation Build Status](https://github.com/reactific/riddl/actions/workflows/gh-pages.yml/badge.svg)
[![Code Build Status](https://github.com/reactific/riddl/actions/workflows/scala.yml/badge.svg)](https://github.com/reactific/riddl/actions/workflows/scala.yml/badge.svg)
[![Documentation Build Status](https://github.com/reactific/riddl/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/reactific/riddl/actions/workflows/gh-pages.yml/badge.svg)
[![Coverage](https://coveralls.io/repos/github/reactific/riddl/badge.svg?branch=coverage)](https://coveralls.io/github/reactific/riddl?branch=coverage)
[![CLA assistant](https://cla-assistant.io/readme/badge/reactific/riddl)](https://cla-assistant.io/reactific/riddl)

[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=reactific_riddl&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=reactific_riddl)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=reactific_riddl&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=reactific_riddl)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=reactific_riddl&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=reactific_riddl)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=reactific_riddl&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=reactific_riddl)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=reactific_riddl&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=reactific_riddl)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=reactific_riddl&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=reactific_riddl)

# RIDDL

## Full Documentation
Expand Down
39 changes: 14 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.jsuereth.sbtpgp.PgpKeys.pgpSigner

import org.scoverage.coveralls.Imports.CoverallsKeys._
import sbtbuildinfo.BuildInfoOption.ToJson
import sbtbuildinfo.BuildInfoOption.ToMap
import sbtbuildinfo.BuildInfoOption.BuildTime
Expand All @@ -20,7 +20,7 @@ Global / onChangedBuildSource := ReloadOnSourceChanges
// IT IS HANDLED BY: sbt-dynver
ThisBuild / dynverSeparator := "-"

lazy val riddl = (project in file(".")).disablePlugins(ScoverageSbtPlugin)
lazy val riddl = (project in file(".")).enablePlugins(ScoverageSbtPlugin)
.enablePlugins(AutomateHeaderPlugin).configure(C.withInfo).settings(
publish := {},
publishLocal := {},
Expand All @@ -33,15 +33,14 @@ lazy val riddl = (project in file(".")).disablePlugins(ScoverageSbtPlugin)
testkit,
prettify,
hugo,
`git-check`,
doc,
riddlc,
plugin
)

lazy val Utils = config("utils")
lazy val utils = project.in(file("utils")).configure(C.mavenPublish)
.configure(C.withCoverage()).enablePlugins(BuildInfoPlugin).settings(
.configure(C.withCoverage(0)).enablePlugins(BuildInfoPlugin).settings(
name := "riddl-utils",
coverageExcludedPackages := "<empty>",
libraryDependencies ++= Seq(Dep.compress, Dep.lang3) ++ Dep.testing,
Expand Down Expand Up @@ -80,7 +79,7 @@ lazy val utils = project.in(file("utils")).configure(C.mavenPublish)
)

val Language = config("language")
lazy val language = project.in(file("language")).configure(C.withCoverage())
lazy val language = project.in(file("language")).configure(C.withCoverage(0))
.configure(C.mavenPublish).settings(
name := "riddl-language",
coverageExcludedPackages :=
Expand All @@ -91,26 +90,28 @@ lazy val language = project.in(file("language")).configure(C.withCoverage())

val Commands = config("commands")

lazy val commands = project.in(file("commands")).configure(C.withCoverage())
.configure(C.mavenPublish).settings(
lazy val commands: Project = project.in(file("commands"))
.configure(C.withCoverage(0)).configure(C.mavenPublish).settings(
name := "riddl-commands",
libraryDependencies ++= Seq(Dep.scopt, Dep.pureconfig) ++ Dep.testing
libraryDependencies ++= Seq(Dep.scopt, Dep.pureconfig, Dep.jgit) ++
Dep.testing
).dependsOn(utils % "compile->compile;test->test", language)

val TestKit = config("testkit")

lazy val testkit = project.in(file("testkit")).configure(C.mavenPublish)
lazy val testkit: Project = project.in(file("testkit"))
.configure(C.mavenPublish)
.settings(name := "riddl-testkit", libraryDependencies ++= Dep.testKitDeps)
.dependsOn(commands % "compile->compile;test->test")

val Prettify = config("prettify")
lazy val prettify = project.in(file("prettify")).configure(C.withCoverage())
lazy val prettify = project.in(file("prettify")).configure(C.withCoverage(0))
.configure(C.mavenPublish)
.settings(name := "riddl-prettify", libraryDependencies ++= Dep.testing)
.dependsOn(commands, testkit % "test->compile").dependsOn(utils)

val HugoTrans = config("hugo")
lazy val hugo: Project = project.in(file("hugo")).configure(C.withCoverage())
lazy val hugo: Project = project.in(file("hugo")).configure(C.withCoverage(0))
.configure(C.mavenPublish).settings(
name := "riddl-hugo",
Compile / unmanagedResourceDirectories += {
Expand All @@ -122,24 +123,12 @@ lazy val hugo: Project = project.in(file("hugo")).configure(C.withCoverage())
.dependsOn(language % "compile->compile", commands, testkit % "test->compile")
.dependsOn(utils)

lazy val GitCheck = config("git-check")
lazy val `git-check`: Project = project.in(file("git-check"))
.configure(C.withCoverage()).configure(C.mavenPublish).settings(
name := "riddl-git-check",
Compile / unmanagedResourceDirectories += {
baseDirectory.value / "resources"
},
Test / parallelExecution := false,
libraryDependencies ++= Seq(Dep.pureconfig, Dep.jgit) ++ Dep.testing
).dependsOn(commands, testkit % "test->compile")

lazy val scaladocSiteProjects = List(
(utils, Utils),
(language, Language),
(commands, Commands),
(testkit, TestKit),
(prettify, Prettify),
(`git-check`, GitCheck),
(hugo, HugoTrans),
(riddlc, Riddlc)
)
Expand Down Expand Up @@ -181,15 +170,15 @@ val Riddlc = config("riddlc")
lazy val riddlc: Project = project.in(file("riddlc"))
.enablePlugins(JavaAppPackaging, UniversalDeployPlugin)
.enablePlugins(MiniDependencyTreePlugin, GraalVMNativeImagePlugin)
.configure(C.mavenPublish).configure(C.withCoverage()).dependsOn(
.configure(C.mavenPublish).configure(C.withCoverage(0)).dependsOn(
utils % "compile->compile;test->test",
commands,
language,
hugo,
`git-check`,
testkit % "test->compile"
).settings(
name := "riddlc",
coverallsTokenFile := Some("/home/reid/.coveralls.yml"),
mainClass := Option("com.reactific.riddl.RIDDLC"),
graalVMNativeImageOptions ++= Seq(
"--verbose",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ com.reactific.riddl.commands.ParseCommand
com.reactific.riddl.commands.RepeatCommand
com.reactific.riddl.commands.StatsCommand
com.reactific.riddl.commands.ValidateCommand
com.reactific.riddl.commands.OnChangeCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2019 Ossum, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

package com.reactific.riddl.commands

import com.reactific.riddl.language.CommonOptions
import com.reactific.riddl.utils.Logger
import org.eclipse.jgit.lib.ProgressMonitor

import java.io.PrintStream

case class DotWritingProgressMonitor(out: PrintStream, log: Logger,
options: CommonOptions)
extends ProgressMonitor {
override def start(totalTasks: Int): Unit = {
if (options.verbose) { log.info(s"Starting Fetch with $totalTasks tasks.") }
else { out.print("\n.") }
}

override def beginTask(title: String, totalWork: Int): Unit = {
if (options.verbose) {
log.info(s"Starting Task '$title', $totalWork remaining.")
} else { out.print(".") }
}

override def update(completed: Int): Unit = {
if (options.verbose) { log.info(s"$completed tasks completed.") }
else { out.print(".") }
}

override def endTask(): Unit = {
if (options.verbose) { log.info(s"Task completed.") }
else { out.println(".") }
}

override def isCancelled: Boolean = false
}
Loading

0 comments on commit 7b93146

Please sign in to comment.