4.0 KiB
Contributing to OpenGraphKt
Thank you for your interest in contributing to OpenGraphKt! This document provides guidelines and instructions for contributing to the project.
Development Setup
Prerequisites
- Java 24 (JVM toolchain)
- Gradle 8.14.3+ (wrapper included)
- Git
Getting Started
-
Clone the repository:
git clone https://github.com/jlengrand/OpenGraphKt.git cd OpenGraphKt -
Build the project:
./gradlew build -
Run tests:
./gradlew test -
Check code coverage:
./gradlew koverXmlReport ./gradlew koverVerify # Enforces 70% minimum coverage
Project Structure
opengraphkt/- Core library module (published to Maven Central)demo/- Local file parsing examplesdemo-remote/- Remote URL parsing examples using published artifactscrape-test/- Testing/scraping utilities
Making Changes
Code Style
- Follow Kotlin coding conventions
- Use meaningful variable and function names
- Add KDoc comments for public APIs
Testing
- Write tests for all new functionality
- Maintain minimum 70% code coverage (enforced by Kover)
- Run tests locally before submitting PR:
./gradlew test
Commits
- Write clear, concise commit messages
- Reference issue numbers when applicable
- Keep commits focused and atomic
Submitting Changes
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests and ensure coverage:
./gradlew test koverVerify - Commit your changes
- Push to your fork
- Submit a Pull Request
Publishing New Versions
This section is for maintainers only.
Version Numbering
OpenGraphKt follows Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for backwards-compatible functionality additions
- PATCH version for backwards-compatible bug fixes
Pre-Release Checklist
-
Update version number in
opengraphkt/build.gradle.kts:version = "0.1.3-SNAPSHOT" // Change to "0.1.3" for release -
Update demo-remote dependency in
demo-remote/build.gradle.kts:dependencies { implementation("fr.lengrand:opengraphkt:0.1.3") // Match release version } -
Run full test suite:
./gradlew clean build test koverVerify -
Test demo applications:
./gradlew :demo:run ./gradlew :demo-remote:run
Publishing to Maven Central
The project uses the com.vanniktech.maven.publish plugin for publishing. Publishing is automated through GitHub Actions.
-
**Bump version ** in
opengraphkt/build.gradle.kts:version = "0.1.4" -
Publish to local Maven for testing (optional):
./gradlew publishToMavenLocal -
Create GitHub release (this triggers the publishing workflow):
- Go to GitHub repository → Releases → "Draft a new release"
- Click "Choose a tag" and create a new tag (e.g.,
v0.1.3) - Set the release title (e.g.,
v0.1.3) - Add release notes describing changes
- Click "Publish release"
-
GitHub Actions will automatically:
- Build the project
- Run tests
- Publish to Maven Central
- The workflow is triggered automatically when you create a new release
-
After a few minutes, you will see the new version in Maven Central. You can also directly check the real-time status on Central Sonartype.
Post-Release Steps
-
Bump version to next SNAPSHOT in
opengraphkt/build.gradle.kts:version = "0.1.5-SNAPSHOT" -
Commit version bump:
git commit -am "Bump version to 0.1.5-SNAPSHOT" git push
Questions?
If you have questions or need help, please:
- Open an issue on GitHub
- Check existing issues and discussions
Thank you for contributing to OpenGraphKt!