Skip to content

Commit

Permalink
Merge pull request #283 from RipplB/qol
Browse files Browse the repository at this point in the history
Build tool upgrades and other various quality of life improvements
  • Loading branch information
leventeBajczi authored Jul 24, 2024
2 parents 36dc99e + e83249d commit a77c3ad
Show file tree
Hide file tree
Showing 25 changed files with 148 additions and 154 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linux-build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ jobs:
dockerprojects: ["theta-cfa-cli", "theta-sts-cli", "theta-xsts-cli", "theta-xta-cli", "theta-xcfa-cli"]
runs-on: ubuntu-latest
steps:
- name: Set java home to java 17
run: |
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Version
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ dest/
.classpath

# Intellij
.idea/
.idea/**
*.iml
*.iws
# useful exclusions
!.idea/copyright
!.idea/copyright/bme_apache2.xml
!.idea/copyright/profiles_settings.xml
!.idea/codeStyles
!.idea/codeStyles/codeStyleConfig.xml
!.idea/codeStyles/Project.xml

# Other
wdl-output.json
Expand Down
78 changes: 78 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copyright/bme_apache2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildscript {

allprojects {
group = "hu.bme.mit.theta"
version = "6.2.0"
version = "6.2.1"

apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts"))
}
Expand All @@ -39,7 +39,7 @@ sonar {
property("sonar.organization", "ftsrg-github")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.coverage.jacoco.xmlReportPaths",
"${project.buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml")
"${project.layout.buildDirectory.asFile.get()}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml")
}
}

Expand All @@ -51,9 +51,9 @@ tasks {
description = "Generates merged code coverage report for all test tasks."

reports {
html.isEnabled = false
xml.isEnabled = true
csv.isEnabled = false
html.required.set(false)
xml.required.set(true)
csv.required.set(false)
}

val reportTasks = subprojects.mapNotNull { subproject ->
Expand Down
18 changes: 6 additions & 12 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -29,10 +28,6 @@ repositories {

apply(from = rootDir.resolve("../gradle/shared-with-buildSrc/mirrors.gradle.kts"))

kotlinDslPluginOptions {
experimentalWarning.set(false)
}

val kotlinVersion: String by project
val shadowVersion: String by project

Expand Down Expand Up @@ -60,30 +55,29 @@ configurations.all {
}

val versionsClassName = "Versions"
val generatedVersionsKotlinSrcDir = buildDir.resolve("generated-sources/versions/kotlin")
val generatedVersionsKotlinSrcDir = layout.buildDirectory.dir("generated-sources/versions/kotlin").get().asFile
val generatedVersionsFile = generatedVersionsKotlinSrcDir.resolve("$versionsClassName.kt")

sourceSets {
named("main") {
withConvention(KotlinSourceSet::class) {
kotlin.srcDir(generatedVersionsKotlinSrcDir)
}
kotlin.srcDir(generatedVersionsKotlinSrcDir)
}
}


fun generateVersionsSource(): String {
val text = StringBuilder()

text.appendln("object $versionsClassName {")
text.appendLine("object $versionsClassName {")

for (property in project.properties) {
if (property.key.endsWith("Version")) {
val keyWithoutVersion = property.key.substringBefore("Version")
text.appendln(" const val `$keyWithoutVersion` = \"${property.value}\"")
text.appendLine(" const val `$keyWithoutVersion` = \"${property.value}\"")
}
}

text.appendln("}")
text.appendLine("}")

return text.toString()
}
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

javaVersion=17
kotlinVersion=1.7.10
kotlinVersion=1.9.25
shadowVersion=7.1.2
antlrVersion=4.9.2
guavaVersion=31.1-jre
Expand All @@ -24,7 +24,8 @@ z3Version=4.5.0
junitVersion=5.9.3
junit4Version=4.12
jacocoVersion=0.8.8
mockitoVersion=2.2.11
mockitoVersion=5.12.0
mockitoKotlinVersion=5.4.0
pnmlFrameworkVersion=2.2.12
emfCommonVersion=2.10.1
emfCodegenVersion=2.10.0
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ object Deps {
object Mockito {

val core = "org.mockito:mockito-core:${Versions.mockito}"
val extension = "org.mockito:mockito-junit-jupiter:${Versions.mockito}"
val kotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}"
}

object Kotlin {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/jacoco-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ extensions.configure<JacocoPluginExtension> {
toolVersion = Versions.jacoco
}

tasks.withType(JacocoReport::class.java).all {
tasks.withType<JacocoReport>().configureEach {
reports {
xml.isEnabled = true
xml.required.set(true)
}
}
}
9 changes: 6 additions & 3 deletions buildSrc/src/main/kotlin/java-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply<JavaPlugin>()
apply(plugin = "jacoco-common")
apply(plugin = "maven-artifact")
plugins {
java
id("jacoco-common")
id("maven-publish") // The correct plugin id for maven-related tasks
}

dependencies {
val implementation: Configuration by configurations
Expand All @@ -33,6 +35,7 @@ dependencies {
testImplementation(Deps.junit5param)
testImplementation(Deps.junit5engine)
testImplementation(Deps.Mockito.core)
testImplementation(Deps.Mockito.extension)
}

tasks {
Expand Down
6 changes: 4 additions & 2 deletions buildSrc/src/main/kotlin/kotlin-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

apply(plugin = "java-common")
apply<KotlinPlatformJvmPlugin>()
plugins {
kotlin("jvm")
}
dependencies {
val implementation: Configuration by configurations
implementation(Deps.Kotlin.stdlib)
implementation(Deps.Kotlin.reflect)
implementation(Deps.Mockito.kotlin)
}
tasks {
withType<KotlinCompile>() {
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/tool-common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ tasks {

tasks.withType<ShadowJar>() {
manifest {
attributes["Implementation-Version"] = version
attributes["Implementation-Version"] = archiveVersion
}
isZip64 = true
}
2 changes: 1 addition & 1 deletion doc/Coding-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We mainly follow the standard Java coding conventions and most of the convention

## Naming and formatting

* **DO** use the generally accepted naming and source code formatting conventions of Java (Item 56 of [1], Chapter 1 of [5]). If you are developing in IntelliJ Idea you can import our commonly used formatting profile (see [Development.md](Development.md) for more information).
* **DO** use the generally accepted naming and source code formatting conventions of Java (Item 56 of [1], Chapter 1 of [5]). If you are developing in IntelliJ Idea the built in formatting by the project can be used (see [Development.md](Development.md) for more information).
* **DO** start project names with the prefix `hu.bme.mit.theta`.
* **DO** use CamelCase for class names containing subsequent capital letters, except when the whole name is a sequence of capital letters. Examples: `CFA`, `CfaEdge`, `OsHelper`.
* **CONSIDER** using abbreviations for well known and common names. Examples: `Expression` -> `Expr`, `Statement` -> `Stmt`, `Counterexample` -> `Cex`.
Expand Down
5 changes: 2 additions & 3 deletions doc/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ We usually develop on separate branches and increment the version number just be

As the main repository is read-only, we suggest you to create your own [fork](https://help.github.com/articles/fork-a-repo/). Within your fork, we also recommend to create new _branches_ for your development. This enables us later on to easily integrate your work into the main repository by using [pull requests](https://help.github.com/articles/about-pull-requests/).

As the framework is under development, we suggest you to [sync your fork](https://help.github.com/articles/syncing-a-fork/) often and merge the master branch into your development branch(es).
If you are confident that only you are working on your branch, you can also [rebase instead of merge](https://www.atlassian.com/git/tutorials/merging-vs-rebasing), but be careful.
As the framework is under development, we suggest you to [sync your fork](https://help.github.com/articles/syncing-a-fork/) often and rebase your development branch(es) onto the master branch.

## Building

Expand All @@ -30,7 +29,7 @@ See [Build.md](Build.md).

- Theta can be imported into [IntelliJ IDEA](https://www.jetbrains.com/idea/) as an existing Gradle project by selecting the _build.gradle.kts_ file in the root of the repository.
- If you want to build the whole project (and not just run a single test for example), make sure to run the _build task of the whole project_. This can be done by opening the Gradle tab, and then selecting _theta / theta / Tasks / build / build_, right clicking and selecting _Run_.
- [Import](https://www.jetbrains.com/help/idea/copying-code-style-settings.html) _doc/ThetaIntelliJCodeStyle.xml_ as a code style scheme for Java so that your formatting settings are consistent with the rest of the project.
- Code styling and copyright noticing should be automatically set up for the ones accepted by the Github CI. It is not recommended to change them.

## Coding conventions

Expand Down
Loading

0 comments on commit a77c3ad

Please sign in to comment.