Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 20 additions & 11 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Publish release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
Expand All @@ -19,21 +16,33 @@ jobs:
run: chmod +x gradlew
- name: Build
run: ./gradlew build
- name: Build inklecate jar
run: ./gradlew :inklecate:jar
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Release build deploy
- name: Publish runtime to Maven Central
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run:
./gradlew clean publish -Prelease -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
- name: Trigger manual upload to Central Repository
run: |
curl -X POST \
-H "Authorization: Bearer $(echo -n '${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}' | base64)" \
-H "Content-Type: application/json" \
https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/com.bladecoder
./gradlew :runtime:clean :runtime:publish -Prelease \
-Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} \
-Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
-Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
- name: Publish compiler to Maven Central
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
./gradlew :compiler:clean :compiler:publish -Prelease \
-Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} \
-Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
-Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
- name: Upload inklecate jar to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: inklecate/build/libs/*.jar
12 changes: 7 additions & 5 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: Publish snapshot

on:
push:
branches:
- master
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
Expand All @@ -20,8 +17,13 @@ jobs:
run: chmod +x gradlew
- name: Build
run: ./gradlew build
- name: Publish snapshot
- name: Publish runtime snapshot
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish
run: ./gradlew :runtime:publish
- name: Publish compiler snapshot
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew :compiler:publish
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ build/
*.log

.DS_Store

prompts/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# blade-ink

This is a Java port of inkle's [ink](https://github.com/inkle/ink), a scripting language for writing interactive narrative.
This is a Java port of inkle's [ink](https://github.com/inkle/ink), a scripting language for writing interactive narrative, including the compiler and inklecate.

**blade-ink** should support pretty much everything the original version does. If you find any bugs, please report them here!

Expand Down
195 changes: 75 additions & 120 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,148 +1,103 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id "com.diffplug.spotless" version "7.2.1"
id "com.diffplug.spotless" version "7.2.1" apply false
}

group = 'com.bladecoder.ink'
// Configuración común para todos los subproyectos
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.diffplug.spotless'

sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
group = 'com.bladecoder.ink'

repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

dependencies {
testImplementation 'junit:junit:4.13'
}
repositories {
mavenCentral()
}

if (!hasProperty("release") && !version.endsWith("-SNAPSHOT")) {
version += "-SNAPSHOT"
}
dependencies {
testImplementation 'junit:junit:4.13'
}

if (!hasProperty("release") && !version.endsWith("-SNAPSHOT")) {
version += "-SNAPSHOT"
}

// DISABLES JAVADOC ULTRACHECKS IN JDK8
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
// DISABLES JAVADOC ULTRACHECKS IN JDK8
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

spotless {
java {
target fileTree('src') {
include '**/*.java'
spotless {
java {
target fileTree('src') {
include '**/*.java'
}
toggleOffOn()
palantirJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
toggleOffOn()
palantirJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}

jar {
manifest.attributes += [
'github' : 'https://github.com/bladecoder/blade-ink/',
'license' : 'Apache-2.0',
'group' : project.group,
'version' : project.version,
'java' : targetCompatibility,
'timestamp': System.currentTimeMillis()
]
}

javadoc {
title = "Blade Ink"
options {
memberLevel = JavadocMemberLevel.PUBLIC
author true
setUse true
encoding "UTF-8"
jar {
manifest.attributes += [
'github' : 'https://github.com/bladecoder/blade-ink/',
'license' : 'Apache-2.0',
'group' : project.group,
'version' : project.version,
'java' : targetCompatibility,
'timestamp': System.currentTimeMillis()
]
}
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}

task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'blade-ink'
from components.java
artifact sourcesJar
artifact javadocJar
javadoc {
options {
memberLevel = JavadocMemberLevel.PUBLIC
author true
setUse true
encoding "UTF-8"
}
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}

versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}

pom {
name = 'blade-ink'
description = "This is a Java port of inkle's ink, a scripting language for writing interactive narrative."
url = 'https://github.com/bladecoder/blade-ink'
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'bladecoder'
name = 'Rafael Garcia'
email = 'bladecoder@gmail.com'
}
}
scm {
connection = 'scm:git@github.com:bladecoder/blade-ink.git'
developerConnection = 'scm:git@github.com:bladecoder/blade-ink.git'
url = 'scm:git@github.com:bladecoder/blade-ink.git'
publishing {
repositories {
maven {
def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username project.hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "$System.env.NEXUS_USERNAME"
password project.hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "$System.env.NEXUS_PASSWORD"
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username project.hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "$System.env.NEXUS_USERNAME"
password project.hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "$System.env.NEXUS_PASSWORD"
}
}
}
}

signing {
if (!version.endsWith('SNAPSHOT')) {
useGpgCmd()
sign publishing.publications.mavenJava
}
}

javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
signing {
if (!version.endsWith('SNAPSHOT')) {
useGpgCmd()
sign publishing.publications.mavenJava
}
}
}


47 changes: 47 additions & 0 deletions compiler/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
dependencies {
implementation project(':runtime')
}
javadoc {
title = "Blade Ink Compiler"
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'blade-ink-compiler'
from components.java
artifact sourcesJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'blade-ink-compiler'
description = "Compiler for inkle's ink scripting language. Converts .ink files to JSON format."
url = 'https://github.com/bladecoder/blade-ink'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'bladecoder'
name = 'Rafael Garcia'
email = 'bladecoder@gmail.com'
}
}
scm {
connection = 'scm:git@github.com:bladecoder/blade-ink-java.git'
developerConnection = 'scm:git@github.com:bladecoder/blade-ink-java.git'
url = 'scm:git@github.com:bladecoder/blade-ink-java.git'
}
}
}
}
}
Loading
Loading