mirror of
https://github.com/jlengrand/OpenGraphKt.git
synced 2026-03-10 15:51:39 +00:00
Compare commits
9 Commits
v0.1.2
...
renovate/m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dad5e92160 | ||
|
|
89dbda55b8 | ||
|
|
d982bc94cb | ||
|
|
f829d56a43 | ||
|
|
0364ab5d0c | ||
|
|
389f16fe1c | ||
|
|
f2cbbe048d | ||
|
|
4333d077c3 | ||
|
|
20dfc326c7 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Java",
|
||||
"image": "mcr.microsoft.com/devcontainers/java:1-21",
|
||||
"image": "mcr.microsoft.com/devcontainers/java:3-21",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/java:1": {
|
||||
"version": "none",
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_24" project-jdk-name="temurin-21" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="temurin-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -66,7 +66,8 @@ The parser extracts `meta[property^=og:]` tags and builds structured data models
|
||||
|
||||
## Development Notes
|
||||
|
||||
- **JVM Toolchain**: Java 24 (see `jvmToolchain(24)` in build files)
|
||||
- **JVM Toolchain**: Java 17 (see `jvmToolchain(17)` in build files)
|
||||
- **Minimum Java Version**: Java 17 (required by Ksoup dependency)
|
||||
- **Testing**: CI matrix tests on Java 17 and 23 via GitHub Actions
|
||||
- **Dependencies**: Core library uses Ksoup (v0.2.5) for HTML parsing and network requests
|
||||
- **Maven Coordinates**: Group `fr.lengrand`, artifact `opengraphkt`, currently at `0.1.2-SNAPSHOT`
|
||||
|
||||
158
CONTRIBUTING.md
Normal file
158
CONTRIBUTING.md
Normal file
@@ -0,0 +1,158 @@
|
||||
# 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 17 or later (JVM toolchain configured for Java 17)
|
||||
- Gradle 8.14.3+ (wrapper included)
|
||||
- Git
|
||||
|
||||
### Getting Started
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://github.com/jlengrand/OpenGraphKt.git
|
||||
cd OpenGraphKt
|
||||
```
|
||||
|
||||
2. Build the project:
|
||||
```bash
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
3. Run tests:
|
||||
```bash
|
||||
./gradlew test
|
||||
```
|
||||
|
||||
4. Check code coverage:
|
||||
```bash
|
||||
./gradlew koverXmlReport
|
||||
./gradlew koverVerify # Enforces 70% minimum coverage
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `opengraphkt/` - Core library module (published to Maven Central)
|
||||
- `demo/` - Local file parsing examples
|
||||
- `demo-remote/` - Remote URL parsing examples using published artifact
|
||||
- `scrape-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
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a feature branch: `git checkout -b feature/your-feature-name`
|
||||
3. Make your changes
|
||||
4. Run tests and ensure coverage: `./gradlew test koverVerify`
|
||||
5. Commit your changes
|
||||
6. Push to your fork
|
||||
7. Submit a Pull Request
|
||||
|
||||
## Publishing New Versions
|
||||
|
||||
This section is for maintainers only.
|
||||
|
||||
### Version Numbering
|
||||
|
||||
OpenGraphKt follows [Semantic Versioning](https://semver.org/):
|
||||
- **MAJOR** version for incompatible API changes
|
||||
- **MINOR** version for backwards-compatible functionality additions
|
||||
- **PATCH** version for backwards-compatible bug fixes
|
||||
|
||||
### Pre-Release Checklist
|
||||
|
||||
1. **Update version number** in `opengraphkt/build.gradle.kts`:
|
||||
```kotlin
|
||||
version = "0.1.3-SNAPSHOT" // Change to "0.1.3" for release
|
||||
```
|
||||
|
||||
2. **Update demo-remote dependency** in `demo-remote/build.gradle.kts`:
|
||||
```kotlin
|
||||
dependencies {
|
||||
implementation("fr.lengrand:opengraphkt:0.1.3") // Match release version
|
||||
}
|
||||
```
|
||||
|
||||
3. **Run full test suite**:
|
||||
```bash
|
||||
./gradlew clean build test koverVerify
|
||||
```
|
||||
|
||||
4. **Test demo applications**:
|
||||
```bash
|
||||
./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.
|
||||
|
||||
1. **Bump version ** in `opengraphkt/build.gradle.kts`:
|
||||
```kotlin
|
||||
version = "0.1.4"
|
||||
```
|
||||
|
||||
2. **Publish to local Maven for testing** (optional):
|
||||
```bash
|
||||
./gradlew publishToMavenLocal
|
||||
```
|
||||
|
||||
3. **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"
|
||||
|
||||
4. **GitHub Actions will automatically**:
|
||||
- Build the project
|
||||
- Run tests
|
||||
- Publish to Maven Central
|
||||
- The workflow is triggered automatically when you create a new release
|
||||
|
||||
5. After a few minutes, you will see the new version in [Maven Central](https://mvnrepository.com/artifact/fr.lengrand/opengraphkt). You can also directly check the real-time status on [Central Sonartype](https://central.sonatype.com/publishing/deployments).
|
||||
|
||||
### Post-Release Steps
|
||||
|
||||
1. **Bump version to next SNAPSHOT** in `opengraphkt/build.gradle.kts`:
|
||||
```kotlin
|
||||
version = "0.1.5-SNAPSHOT"
|
||||
```
|
||||
|
||||
2. **Commit version bump**:
|
||||
```bash
|
||||
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!
|
||||
@@ -10,7 +10,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("fr.lengrand:opengraphkt:0.1.0")
|
||||
implementation("fr.lengrand:opengraphkt:0.1.3")
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ tasks.test {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(24)
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = "fr.lengrand.opengraphkt.MainKt"
|
||||
mainClass = "fr.lengrand.opengraphktremote.MainKt"
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ tasks.test {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(24)
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
application {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import com.vanniktech.maven.publish.SonatypeHost
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("com.vanniktech.maven.publish") version "0.32.0"
|
||||
id("org.jetbrains.kotlinx.kover") version "0.9.1"
|
||||
id("com.vanniktech.maven.publish") version "0.34.0"
|
||||
id("org.jetbrains.kotlinx.kover") version "0.9.3"
|
||||
}
|
||||
|
||||
group = "fr.lengrand"
|
||||
version = "0.1.2"
|
||||
version = "0.1.4-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -35,12 +33,20 @@ tasks.jar {
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(24)
|
||||
jvmToolchain(17)
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
|
||||
mavenPublishing {
|
||||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
|
||||
publishToMavenCentral()
|
||||
|
||||
signAllPublications()
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@ tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
kotlin {
|
||||
jvmToolchain(24)
|
||||
jvmToolchain(17)
|
||||
}
|
||||
Reference in New Issue
Block a user