Skip to content

Commit

Permalink
Changing up
Browse files Browse the repository at this point in the history
  • Loading branch information
mjovanc committed May 23, 2023
1 parent e6bb618 commit a79daac
Show file tree
Hide file tree
Showing 35 changed files with 212 additions and 310 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
name: "Build: ${{ matrix.config.name }} / ${{ matrix.config.platform }}"
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [stable]
config:
- { name: "Windows Latest", os: windows-latest, platform: x64 }
- { name: "Ubuntu Latest", os: ubuntu-latest, platform: x64 }
- { name: "macOS 11", os: macos-11, platform: x64 }
- { name: "macOS Latest", os: macos-latest, platform: arm64 }

steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- name: Set up OpenJDK 17
uses: actions/setup-java@v3
with:
toolchain: ${{ matrix.rust }}
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Checkout repository
uses: actions/checkout@v3

- name: Build and test
run: |
cargo build --verbose
cargo test --verbose
- name: Assemble
run: ./gradlew assemble
29 changes: 16 additions & 13 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,26 @@ on: pull_request

jobs:
build:
runs-on: ${{ matrix.os }}
name: "Build: ${{ matrix.config.name }} / ${{ matrix.config.platform }}"
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [stable]
config:
- { name: "Windows Latest", os: windows-latest, platform: x64 }
- { name: "Ubuntu Latest", os: ubuntu-latest, platform: x64 }
- { name: "macOS 11", os: macos-11, platform: x64 }
- { name: "macOS Latest", os: macos-latest, platform: arm64 }

steps:
- name: Set up Rust
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- name: Set up OpenJDK 17
uses: actions/setup-java@v3
with:
toolchain: ${{ matrix.rust }}
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Checkout repository
uses: actions/checkout@v3

- name: Build and test
run: |
cargo build --verbose
cargo test --verbose
- name: Assemble
run: ./gradlew assemble
61 changes: 49 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,52 @@
### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/
### Kotlin ###
# Compiled class file
*.class

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# Log file
*.log

# These are backup files generated by rustfmt
**/*.rs.bk
# BlueJ files
*.ctxt

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Gradle ###
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Gradle Patch ###
# Java heap dump
*.hprof
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

6 changes: 6 additions & 0 deletions .idea/JetClient/state.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/compiler.xml

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

16 changes: 16 additions & 0 deletions .idea/gradle.xml

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

20 changes: 20 additions & 0 deletions .idea/jarRepositories.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/jpa-buddy.xml

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

11 changes: 11 additions & 0 deletions .idea/misc.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/vcs.xml

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

6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

45 changes: 0 additions & 45 deletions .vscode/launch.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

20 changes: 0 additions & 20 deletions Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Hugin API

[![build](https://img.shields.io/github/actions/workflow/status/kryptokrona/hugin-api/main-ci.yml?branch=main)](https://github.com/kryptokrona/hugin-api/actions/workflows/main-ci.yml)
[![kotlin](https://img.shields.io/badge/kotlin-1.8.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![release](https://img.shields.io/github/v/release/kryptokrona/hugin-api)](https://img.shields.io/github/v/release/kryptokrona/hugin-api)
[![license](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
![](https://img.shields.io/badge/Rust-1.69+-orange.svg)
[![discord](https://img.shields.io/discord/562673808582901793?label=discord)](https://discord.gg/VTgsTGS9b7)

Hugin is a messaging service where messages are stored on the Kryptokrona Blockchain. Messages are secured with industry leading encryption so that only you and your chat partner have the possibility to read them. The purpose is not to gather any personal information about the users, unlike most apps and social media.
Expand Down
33 changes: 33 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
kotlin("multiplatform") version "1.8.21"
}

group = "org.kryptokrona.huginapi"
version = "0.4.0"

repositories {
mavenCentral()
}

kotlin {
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}

nativeTarget.apply {
binaries {
executable {
entryPoint = "main"
}
}
}
sourceSets {
val nativeMain by getting
val nativeTest by getting
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 9 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}

}
rootProject.name = "hugin-api"

1 change: 0 additions & 1 deletion src/db/mod.rs

This file was deleted.

Loading

0 comments on commit a79daac

Please sign in to comment.