Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gmitch215 committed Oct 10, 2024
0 parents commit b1b46e3
Show file tree
Hide file tree
Showing 19 changed files with 888 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary

10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: daily
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
158 changes: 158 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Build Project

on:
push:
branches: [ master, ver/* ]
pull_request:
branches: [ master, ver/* ]

workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
timeout-minutes: 20

name: Gradle Setup
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
cache: 'gradle'
- name: Change Permissions
run: chmod +x ./gradlew
- name: Gradle Information
run: ./gradlew project tasks dependencies

build:
runs-on: ${{ matrix.os }}
needs: setup
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java-version: [8, 11, 17, 21]

name: Build Java ${{ matrix.java-version }} / ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
cache: 'gradle'
- name: Change Permissions
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew assemble publishToMavenLocal

test:
runs-on: macos-latest
timeout-minutes: 10
needs: setup

permissions:
checks: write
pull-requests: write

name: Test Project
steps:
- uses: actions/checkout@v4
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
cache: 'gradle'
- name: Change Permissions
run: chmod +x ./gradlew
- name: Gradle Test
run: ./gradlew allTests jvmJacocoTestReport
- name: Collect JaCoCo Report
if: ${{ github.event_name != 'pull_request' }}
id: jacoco_reporter
uses: PavanMudigonda/jacoco-reporter@v5.1
with:
coverage_results_path: build/jacoco.xml
coverage_report_name: Code Coverage
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_check_run: false
minimum_coverage: 85
fail_below_threshold: false
publish_only_summary: false
- name: Print JaCoCo Report
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "| Outcome | Value |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Code Coverage % | ${{ steps.jacoco_reporter.outputs.coverage_percentage }} |" >> $GITHUB_STEP_SUMMARY
echo "| :heavy_check_mark: Number of Lines Covered | ${{ steps.jacoco_reporter.outputs.covered_lines }} |" >> $GITHUB_STEP_SUMMARY
echo "| :x: Number of Lines Missed | ${{ steps.jacoco_reporter.outputs.missed_lines }} |" >> $GITHUB_STEP_SUMMARY
echo "| Total Number of Lines | ${{ steps.jacoco_reporter.outputs.total_lines }} |" >> $GITHUB_STEP_SUMMARY
- name: Upload Code Coverage Artifacts (Push)
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: "*/coverage-results.md"
- name: Upload Code Coverage Artifacts (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
uses: madrapps/jacoco-report@v1.7.1
with:
paths: build/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
pass-emoji:
min-coverage-overall: 85
min-coverage-changed-files: 90

deploy:
runs-on: ubuntu-latest
needs: [build, test]
name: Deploy Dokka
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Change Permissions
run: chmod +x ./gradlew
- name: Build Dokka
run: ./gradlew dokkaHtml
- name: Deploy Dokka
run: bash dokka.sh ${GITHUB_SHA::7}

publish:
runs-on: macos-latest
needs: [build, test]
name: Publish to Repository
if: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
cache: 'gradle'
- name: Change Permissions
run: chmod +x ./gradlew
- name: Publish to Repository
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -Psnapshot=true
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Project
on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: macos-latest
name: Publish to Repository
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
cache: 'gradle'
- name: Change Permissions
run: chmod +x ./gradlew
- name: Publish to Repository
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
.vscode/
build/
.gradle/
.kotlin/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 DocuMake

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DScanner

> Multiplatform tool to scan source files for classes, functions, interfaces, and more.
132 changes: 132 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
kotlin("multiplatform") version "2.0.21"
id("org.jetbrains.dokka") version "1.9.20"

`maven-publish`
jacoco
}

val v = "0.1.0"

group = "xyz.calcugames.documake"
version = if (project.hasProperty("snapshot")) "$v-SNAPSHOT" else v

repositories {
mavenCentral()
mavenLocal()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlin {
applyDefaultHierarchyTemplate()

jvm()
js {
browser {
testTask {
enabled = false
}
}
nodejs()
generateTypeScriptDefinitions()
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser {
testTask {
enabled = false
}
}
nodejs {
testTask {
useMocha {
timeout = "10m"
}
}
}
generateTypeScriptDefinitions()
}
@OptIn(ExperimentalWasmDsl::class)
wasmWasi {
nodejs {
testTask {
useMocha {
timeout = "10m"
}
}
}
}

androidNativeX64()
androidNativeX86()
androidNativeArm32()
androidNativeArm64()

mingwX64()
linuxArm64()
linuxX64()

macosX64()
macosArm64()
iosX64()
iosSimulatorArm64()
iosArm64()
tvosX64()
tvosSimulatorArm64()
tvosArm64()
watchosX64()
watchosSimulatorArm64()
watchosDeviceArm64()
watchosArm32()
watchosArm64()

sourceSets {
commonTest.dependencies {
implementation(kotlin("test"))
}
}
}

publishing {
publications {
getByName<MavenPublication>("kotlinMultiplatform") {
pom {
name = "DScanner"
description = "Multiplatform tool for scanning source code"
url = "https://documake.calcugames.xyz"

licenses {
license {
name = "MIT License"
url = "https://opensource.org/licenses/MIT"
}
}

scm {
connection = "scm:git:git://github.com/DocuMake/DScanner.git"
developerConnection = "scm:git:ssh://github.com/DocuMake/DScanner.git"
url = "https://github.com/LDocuMake/DScanner"
}
}
}
}

repositories {
maven {
credentials {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}

val releases = "https://repo.calcugames.xyz/repository/maven-releases/"
val snapshots = "https://repo.calcugames.xyz/repository/maven-snapshots/"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshots else releases)
}
}
}
Loading

0 comments on commit b1b46e3

Please sign in to comment.