-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from amank22/publish_modules
Published Api Module
- Loading branch information
Showing
15 changed files
with
281 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Logvue Build | ||
name: Logvue Build Pre-Prod | ||
|
||
env: | ||
GITHUB_DEPLOY: 'false' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Logvue Publish | ||
|
||
env: | ||
GITHUB_DEPLOY: 'false' | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
name: Release build and publish | ||
continue-on-error: false | ||
|
||
runs-on: ubuntu-latest | ||
environment: Production | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
jdk: [ 18 ] | ||
|
||
steps: | ||
- name: Check out the source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download OpenJDK ${{ matrix.jdk }} | ||
id: download-jdk | ||
uses: sormuras/download-jdk@v1 | ||
with: | ||
feature: ${{ matrix.jdk }} | ||
|
||
- name: Set up OpenJDK ${{ matrix.jdk }} | ||
id: setup-java | ||
uses: actions/setup-java@v2 | ||
if: always() && steps.download-jdk.outcome == 'success' | ||
with: | ||
distribution: jdkfile | ||
java-version: ${{ env.JDK_VERSION }} | ||
jdkFile: ${{ env.JDK_FILE }} | ||
|
||
- name: Cache Gradle dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
# Runs upload, and then closes & releases the repository | ||
- name: Publish to MavenCentral | ||
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
15 changes: 15 additions & 0 deletions
15
buildSrc/src/main/kotlin/com/voxfinite/logvue/Configuration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.voxfinite.logvue | ||
|
||
object Configuration { | ||
|
||
object Api { | ||
const val majorVersion = 1 | ||
const val minorVersion = 0 | ||
const val patchVersion = 0 | ||
const val versionName = "$majorVersion.$minorVersion.$patchVersion" | ||
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT" | ||
const val isSnapshot = false | ||
const val artifactGroup = "io.github.amank22.logvue" | ||
const val artifactId = "api" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
buildSrc/src/main/kotlin/com/voxfinite/logvue/Dependencies.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.voxfinite.logvue | ||
|
||
object Versions { | ||
const val LogVueApi = "1.0.0" | ||
const val P4fj = "3.6.0" | ||
} | ||
|
||
object Dependencies { | ||
const val LogVueApi = "io.github.amank22.logvue:api:${Versions.LogVueApi}" | ||
const val Pf4j = "org.pf4j:pf4j:${Versions.P4fj}" | ||
} |
41 changes: 41 additions & 0 deletions
41
buildSrc/src/main/kotlin/com/voxfinite/logvue/utils/GradleExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.voxfinite.logvue.utils | ||
|
||
import org.gradle.api.Project | ||
import java.io.File | ||
|
||
fun Project.getMainAppVersion() : String { | ||
val key = "APP_VERSION" | ||
return if (hasProperty(key)) { | ||
val version = property("APP_VERSION").toString() | ||
println("Version = $version") | ||
if (version.isBlank()) { | ||
return "1.0.0" | ||
} | ||
if (version.matches(Regex("^[\\d]{1,3}.[\\d]{1,3}.[\\d]{1,4}"))) { | ||
return version | ||
} | ||
if (version.matches(Regex("^v[\\d]{1,3}.[\\d]{1,3}.[\\d]{1,4}"))) { | ||
return version.removePrefix("v") | ||
} | ||
"1.0.0" | ||
} else { | ||
"1.0.0" | ||
} | ||
} | ||
|
||
fun File.findPkg(format: String?) = when (format != null) { | ||
true -> walk().firstOrNull { it.isFile && it.name.endsWith(format, ignoreCase = true) } | ||
else -> null | ||
} | ||
|
||
fun File?.ghActionOutput(prefix: String) = this?.let { | ||
when (System.getenv("GITHUB_ACTIONS").toBoolean()) { | ||
true -> println( | ||
""" | ||
::set-output name=${prefix}_name::${it.name} | ||
::set-output name=${prefix}_path::${it.absolutePath} | ||
""".trimIndent() | ||
) | ||
else -> println("$prefix: $this") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
kotlin.code.style=official | ||
#kotlin.native.binary.memoryModel=experimental | ||
|
||
# PF4J | ||
pf4jVersion=3.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import com.voxfinite.logvue.Dependencies | ||
plugins { | ||
kotlin("kapt") | ||
} | ||
|
||
val pf4jVersion: String by project | ||
|
||
dependencies { | ||
compileOnly(project(":api")) | ||
compileOnly(Dependencies.LogVueApi) | ||
compileOnly(kotlin("stdlib")) | ||
|
||
compileOnly("org.pf4j:pf4j:${pf4jVersion}") | ||
kapt("org.pf4j:pf4j:${pf4jVersion}") | ||
compileOnly(Dependencies.Pf4j) | ||
kapt(Dependencies.Pf4j) | ||
// implementation("org.apache.commons:commons-lang3:3.5") // this is an example for an external library included | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
apply plugin: 'org.jetbrains.dokka' | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
|
||
tasks.withType(dokkaHtmlPartial.getClass()).configureEach { | ||
pluginsMapConfiguration.set( | ||
["org.jetbrains.dokka.base.DokkaBase": """{ "separateInheritedMembers": true}"""] | ||
) | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { | ||
archiveClassifier.set('javadoc') | ||
from dokkaJavadoc.outputDirectory | ||
} | ||
|
||
group = PUBLISH_GROUP_ID | ||
version = PUBLISH_VERSION | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId PUBLISH_GROUP_ID | ||
artifactId PUBLISH_ARTIFACT_ID | ||
version PUBLISH_VERSION | ||
from components.java | ||
artifact javadocJar | ||
|
||
pom { | ||
name = PUBLISH_ARTIFACT_ID | ||
description = 'Monitor, analyse local analytics from ADB and use SQL-Like query to filter logs on desktop' | ||
url = 'https://github.com/amank22/LogVue' | ||
licenses { | ||
license { | ||
name = 'GPL-3.0 License' | ||
url = 'https://github.com/amank22/LogVue/blob/main/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'amank22' | ||
name = 'Aman Kapoor' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:github.com/amank22/logvue.git' | ||
developerConnection = 'scm:git:ssh://github.com/amank22/logvue.git' | ||
url = 'https://github.com/amank22/LogVue/tree/main' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
useInMemoryPgpKeys( | ||
rootProject.ext["signing.keyId"], | ||
rootProject.ext["signing.key"], | ||
rootProject.ext["signing.password"], | ||
) | ||
sign publishing.publications | ||
} |
Oops, something went wrong.