Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

Commit 98b3f8d

Browse files
authored
Build fix for JVM (#11)
1 parent 2576e2b commit 98b3f8d

File tree

3 files changed

+80
-58
lines changed

3 files changed

+80
-58
lines changed

README.md

Lines changed: 62 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
[![Version](https://img.shields.io/github/v/release/milosmns/code-stats?label=Latest&color=green)](./releases)  
2-
[![Build Status](https://img.shields.io/github/actions/workflow/status/milosmns/code-stats/build-ga.yaml?label=Build)](./actions/workflows/build-ga.yaml)  
3-
[![License: NT-GPL v3](https://img.shields.io/badge/License-NTGPLv3-blue)](./LICENSE)  
4-
[![Issues](https://img.shields.io/github/issues-raw/milosmns/code-stats?label=Issues&color=gold)](./issues)  
5-
[![Discussions](https://img.shields.io/github/discussions/milosmns/code-stats?label=Discussions&color=pink)](./discussions)  
1+
[![Version](https://img.shields.io/github/v/release/milosmns/code-stats?label=Latest&color=green)](https://github.com/milosmns/code-stats/releases)
2+
 
3+
[![Build Status](https://img.shields.io/github/actions/workflow/status/milosmns/code-stats/build-ga.yaml?label=Build)](https://github.com/milosmns/code-stats/actions/workflows/build-ga.yaml)
4+
 
5+
[![License: NT-GPL v3](https://img.shields.io/badge/License-NTGPLv3-blue)](./LICENSE)
6+
 
7+
[![Issues](https://img.shields.io/github/issues-raw/milosmns/code-stats?label=Issues&color=gold)](https://github.com/milosmns/code-stats/issues)
8+
 
9+
[![Discussions](https://img.shields.io/github/discussions/milosmns/code-stats?label=Discussions&color=pink)](https://github.com/milosmns/code-stats/discussions)
10+
 
611

712
[//]: # (Inspired by https://github.com/othneildrew/Best-README-Template/blob/master/BLANK_README.md)
813

914
<br/>
1015
<br/>
11-
<div align="center">
16+
<div style="text-align: center">
17+
<!--suppress CheckImageSize -->
1218
<img src="./readme/media/code-stats-logo-icon.png" alt="Logo" width="128" height="128">
1319
<h3>Code Stats</h3>
1420

@@ -18,25 +24,33 @@
1824
Dive in and transform your team workflows!
1925
<br/>
2026
<br/>
21-
<a href="./issues">Report a bug</a>
27+
<a href="https://github.com/milosmns/code-stats/issues">Report a bug</a>
2228
·
23-
<a href="./issues">Request a feature</a>
29+
<a href="https://github.com/milosmns/code-stats/issues">Request a feature</a>
2430
·
25-
<a href="./discussions">Meet & say thanks</a>
31+
<a href="https://github.com/milosmns/code-stats/discussions">Meet & say thanks</a>
2632
</p>
2733
</div>
2834

2935
### Built using
3036

31-
[![Kotlin](https://img.shields.io/badge/kotlin-37F52FF.svg?style=for-the-badge&logo=kotlin&logoColor=white)](https://kotlinlang.org) &nbsp;
32-
[![Ktor](https://img.shields.io/badge/ktor-07405E.svg?style=for-the-badge&logo=kotlin&logoColor=white)](https://ktor.io) &nbsp;
33-
[![SQLDelight](https://img.shields.io/badge/SQL%20Delight-07405E.svg?style=for-the-badge&logo=kotlin&logoColor=white)](https://github.com/cashapp/sqldelight) &nbsp;
34-
[![SQLite](https://img.shields.io/badge/sqlite-FF405E.svg?style=for-the-badge&logo=sqlite&logoColor=white)](https://www.sqlite.org) &nbsp;
35-
36-
[![HTML5](https://img.shields.io/badge/html5-E34F26.svg?style=for-the-badge&logo=html5&logoColor=white)](https://www.w3schools.com/html) &nbsp;
37-
[![Bootstrap](https://img.shields.io/badge/bootstrap-8511FA.svg?style=for-the-badge&logo=bootstrap&logoColor=white)](https://getbootstrap.com) &nbsp;
38-
[![JavaScript](https://img.shields.io/badge/javascript-323330.svg?style=for-the-badge&logo=javascript&logoColor=F7DF1E)](https://www.javascript.com) &nbsp;
39-
[![Chart.js](https://img.shields.io/badge/chart.js-F5788D.svg?style=for-the-badge&logo=chart.js&logoColor=white)](https://www.chartjs.org) &nbsp;
37+
[![Kotlin](https://img.shields.io/badge/kotlin-37F52FF.svg?style=for-the-badge&logo=kotlin&logoColor=white)](https://kotlinlang.org)
38+
&nbsp;
39+
[![Ktor](https://img.shields.io/badge/ktor-07405E.svg?style=for-the-badge&logo=kotlin&logoColor=white)](https://ktor.io)
40+
&nbsp;
41+
[![SQLDelight](https://img.shields.io/badge/SQL%20Delight-07405E.svg?style=for-the-badge&logo=kotlin&logoColor=white)](https://github.com/cashapp/sqldelight)
42+
&nbsp;
43+
[![SQLite](https://img.shields.io/badge/sqlite-FF405E.svg?style=for-the-badge&logo=sqlite&logoColor=white)](https://www.sqlite.org)
44+
&nbsp;
45+
46+
[![HTML5](https://img.shields.io/badge/html5-E34F26.svg?style=for-the-badge&logo=html5&logoColor=white)](https://www.w3schools.com/html)
47+
&nbsp;
48+
[![Bootstrap](https://img.shields.io/badge/bootstrap-8511FA.svg?style=for-the-badge&logo=bootstrap&logoColor=white)](https://getbootstrap.com)
49+
&nbsp;
50+
[![JavaScript](https://img.shields.io/badge/javascript-323330.svg?style=for-the-badge&logo=javascript&logoColor=F7DF1E)](https://www.javascript.com)
51+
&nbsp;
52+
[![Chart.js](https://img.shields.io/badge/chart.js-F5788D.svg?style=for-the-badge&logo=chart.js&logoColor=white)](https://www.chartjs.org)
53+
&nbsp;
4054

4155
#### Support
4256

@@ -56,7 +70,8 @@ However, the GitHub page leaves a lot to be desired.
5670
For example, have you ever wondered about your project's [Cycle Time](https://tulip.co/blog/cycle-vs-lead-vs-takt)?
5771
Are you blocking each other, or things are moving smoothly through your development pipeline?
5872
Have you wondered about the evolution of this metric over time?
59-
This metric (and many more) can be computed using the raw contribution data available in code repositories and at GitHub.
73+
This metric (and many more) can be computed using the raw contribution data available
74+
in code repositories and at GitHub.
6075

6176
To make time theft more visible, Code Stats aims to provide an alternative interface to GitHub's insights pages.
6277
Take a look at some of the examples below.
@@ -66,9 +81,10 @@ Take a look at some of the examples below.
6681

6782
## Getting Started
6883

69-
The project is build with [Kotlin/Native](https://kotlinlang.org/docs/native-overview.html) (supporting multi-platform native binaries).
84+
The project is build with [Kotlin/Native](https://kotlinlang.org/docs/native-overview.html)
85+
(supporting multi-platform native binaries).
7086
However, due to complications with the automation pipelines and some issues with Kotlin's native compiler (Konan),
71-
native binaries are <u>**temporarily** disabled</u>.
87+
native binary outputs are <u>**temporarily** disabled</u>.
7288

7389
For the time being, you can still use the packages available for the Java Virtual Machine (JVM).
7490

@@ -83,21 +99,22 @@ This is done by setting an environment variable called `GITHUB_TOKEN`.
8399

84100
To run the JVM flavor, you need:
85101

86-
* Java installed and available on the Path; OpenJDK is fine.
102+
* Java installed and available on the Path; OpenJDK is fine.
87103

88104
### Prerequisites for building
89105

90106
##### JVM
91107

92108
To build the JVM flavor, you need:
93109

94-
* Java installed and available on the Path; OpenJDK is fine.
110+
* Java installed and available on the Path; OpenJDK is fine.
95111

96112
## How to run
97113

98114
##### JVM
99115

100-
Simply download the latest version from [Releases](./releases) and run it using Java:
116+
Simply download the latest version from [Releases](https://github.com/milosmns/code-stats/releases)
117+
and run it using Java:
101118

102119
```console
103120
$ java -jar codestats.jar --help
@@ -107,13 +124,15 @@ $ java -jar codestats.jar --help
107124

108125
##### JVM
109126

110-
Clone the project's repository to your local machine. Then, from the project's root directory run:
127+
Clone the project's repository to your local machine.
128+
Then, from the project's root directory run:
111129

112130
```console
113131
$ ./gradlew shadowJar
114132
```
115133

116-
Your output should be exactly the same as the [latest Release](./releases), and stored in `build/libs/codestats.jar`.
134+
Your output should be exactly the same as the [latest Release](https://github.com/milosmns/code-stats/releases),
135+
and stored in `build/libs/codestats.jar`.
117136

118137
## Usage
119138

@@ -131,11 +150,11 @@ $ codestats --help
131150

132151
There are several modes that Code Stats can run in.
133152

134-
1. **Fetch** – fetches fresh contribution data and stores it locally for analysis
135-
1. **Print** – calculates and prints all of the code stats (metrics) to `stdout`
136-
1. **Report** – prints a short report on what data is available locally
137-
1. **Serve** – launches a backend server locally, and prints the access URL for the web UI
138-
1. **Purge** – deletes all locally stored data
153+
1. **Fetch** – fetches fresh contribution data and stores it locally for analysis
154+
1. **Print** – calculates and prints all the code stats (metrics) to `stdout`
155+
1. **Report** – prints a short report on what data is available locally
156+
1. **Serve** – launches a backend server locally, and prints the access URL for the web UI
157+
1. **Purge** – deletes all locally stored data
139158

140159
To choose a mode, simply add a `--mode` modifier:
141160

@@ -155,10 +174,10 @@ owner: nasa # GitHub repository owner
155174
startDate: 2023-01-01 # no data before this date
156175
endDate: 2023-03-15 # no data after this date
157176

158-
teams: # all teams you'd like to inspect
177+
teams: # all teams you'd like to inspect
159178
- title: Flight Team # GitHub user-friendly team name
160179
name: nasa-flight # GitHub team ID
161-
codeRepositories: # where the code lives
180+
codeRepositories: # where the code lives
162181
- openmct
163182
- HyperCP
164183
- cmr-stac
@@ -179,15 +198,15 @@ You can also refer to the [sample configuration file](./src/commonMain/resources
179198

180199
There are even more configuration options you can use as environment variables:
181200

182-
* <font color="red">`GITHUB_TOKEN`</font> – the (mandatory) authentication token for communicating with GitHub
183-
* `GITHUB_URL` – a REST GitHub Enterprise URL; default is `api.github.com`
184-
* `GITHUB_GRAPHQL_URL` – a GraphQL GitHub Enterprise URL; default is `api.github.com/graphql`
185-
* `GITHUB_PAGING_LIMIT` – how many items to fetch per page (when paging); default is `100`
186-
* `GITHUB_VERBOSE` – whether to print verbose update in the console; default is `false`
187-
* `GITHUB_PRINT_PROGRESS` – whether to print progress updates for GitHub API fetch; default is `true`
188-
* `GITHUB_RATE_LIMIT_DELAY_MILLIS` – a rate-limiting delay for requests to GitHub; default is `2.1s`
189-
* `DATABASE_PATH` – which local database to use (file path); default is `code-stats.db`
190-
* `STATS_PORT_API` – on which port to launch the server for the web UI; default is `8080`
201+
* <font color="red">`GITHUB_TOKEN`</font> – the (mandatory) authentication token for communicating with GitHub
202+
* `GITHUB_URL` – a REST GitHub Enterprise URL; default is `api.github.com`
203+
* `GITHUB_GRAPHQL_URL` – a GraphQL GitHub Enterprise URL; default is `api.github.com/graphql`
204+
* `GITHUB_PAGING_LIMIT` – how many items to fetch per page (when paging); default is `100`
205+
* `GITHUB_VERBOSE` – whether to print verbose update in the console; default is `false`
206+
* `GITHUB_PRINT_PROGRESS` – whether to print progress updates for GitHub API fetch; default is `true`
207+
* `GITHUB_RATE_LIMIT_DELAY_MILLIS` – a rate-limiting delay for requests to GitHub; default is `2.1s`
208+
* `DATABASE_PATH` – which local database to use (file path); default is `code-stats.db`
209+
* `STATS_PORT_API` – on which port to launch the server for the web UI; default is `8080`
191210

192211
The executable will automatically read these variables and apply them before running.
193212

@@ -200,5 +219,5 @@ To read the contributions guideline, go to [CONTRIBUTING](./CONTRIBUTING).
200219

201220
## License
202221

203-
Distributed under the Non-Toxic GNU GPL v3 License.
222+
Distributed under the Non-Toxic GNU GPL v3 License.
204223
See [LICENSE](./LICENSE) for more information about this particular license.

build.gradle.kts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.gradle.internal.impldep.org.joda.time.LocalDateTime
88
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
99
import org.jetbrains.kotlin.gradle.dsl.KotlinTargetContainerWithPresetFunctions
1010
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
11+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests
1112

1213
plugins {
1314
application
@@ -97,20 +98,20 @@ kotlin {
9798
}
9899

99100
// used by the 'getting' delegate
100-
@Suppress("UNUSED_VARIABLE", "KotlinRedundantDiagnosticSuppress")
101-
val macNativeMain by getting {
102-
dependsOn(commonMain)
103-
dependencies {
104-
implementation("io.ktor:ktor-client-curl:2.3.+")
105-
implementation("app.cash.sqldelight:native-driver:2.+")
106-
}
107-
}
101+
// @Suppress("UNUSED_VARIABLE", "KotlinRedundantDiagnosticSuppress")
102+
// val macNativeMain by getting {
103+
// dependsOn(commonMain)
104+
// dependencies {
105+
// implementation("io.ktor:ktor-client-curl:2.3.+")
106+
// implementation("app.cash.sqldelight:native-driver:2.+")
107+
// }
108+
// }
108109

109110
// used by the 'getting' delegate
110-
@Suppress("UNUSED_VARIABLE", "KotlinRedundantDiagnosticSuppress")
111-
val macNativeTest by getting {
112-
dependsOn(commonTest)
113-
}
111+
// @Suppress("UNUSED_VARIABLE", "KotlinRedundantDiagnosticSuppress")
112+
// val macNativeTest by getting {
113+
// dependsOn(commonTest)
114+
// }
114115

115116
}
116117

@@ -409,9 +410,11 @@ class Configurator(private val env: Env, private val output: Output) {
409410
println("Configured Kotlin target '$name'")
410411
}
411412

412-
fun configureNativeTarget(container: KotlinTargetContainerWithPresetFunctions) =
413+
@Suppress("USELESS_CAST", "UNUSED_PARAMETER")
414+
fun configureNativeTarget(container: KotlinTargetContainerWithPresetFunctions): KotlinNativeTargetWithHostTests? =
413415
when (env.currentPlatform) {
414-
Env.Platform.MAC -> null // TODO – disabled temporarily until the build is fixed
416+
// TODO – disabled temporarily until the build is fixed
417+
Env.Platform.MAC -> null as? KotlinNativeTargetWithHostTests?
415418
// when (env.currentArch) {
416419
// Env.Arch.X86 -> container.macosX64(env.currentPlatform.targetName)
417420
// Env.Arch.ARM -> container.macosArm64(env.currentPlatform.targetName)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ org.gradle.jvmargs=-Xmx4096m
99
# Project properties
1010
config.group = xyz.marinkovic.milos
1111
config.artifact = codestats
12-
config.version = 0.8.0
12+
config.version = 0.9.0
1313
config.gitHubRepoOwner = milosmns
1414
config.gitHubRepoName = code-stats

0 commit comments

Comments
 (0)