Skip to content

Commit

Permalink
build: move from slatekit to kiit cli (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
kishorereddy authored Dec 12, 2022
1 parent 63491ad commit dd9271e
Show file tree
Hide file tree
Showing 85 changed files with 123 additions and 124 deletions.
24 changes: 12 additions & 12 deletions build/slatekit-package-cli
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

# Initialize variables
SLATEKIT_ROOT=/Users/kishorereddy/git/slatekit
SLATEKIT_HOME=${SLATEKIT_ROOT}/slatekit
SLATEKIT_DIST=${SLATEKIT_HOME}/src/lib/kotlin/slatekit/build/distributions
SLATEKIT_REL=${SLATEKIT_HOME}/src/lib/kotlin/slatekit/build/distributions/slatekit
SLATEKIT_CLI=${SLATEKIT_ROOT}/slatekit-cli
KIIT_ROOT=/Users/kishorereddy/git/slatekit
KIIT_HOME=${KIIT_ROOT}/slatekit
KIIT_DIST=${KIIT_HOME}/src/lib/kotlin/kiit/build/distributions
KIIT_REL=${KIIT_HOME}/src/lib/kotlin/kiit/build/distributions/kiit
KIIT_CLI=${KIIT_ROOT}/kiit-cli

# Unzip
#cd $SLATEKIT_DIST
#unzip ${SLATEKIT_DIST}/slatekit.zip
#cd $KIIT_DIST
#unzip ${KIIT_DIST}/slatekit.zip

# Copy bin/lib/templates
cp $SLATEKIT_REL/bin/slatekit $SLATEKIT_CLI/slatekit
cp $SLATEKIT_REL/bin/slatekit.bat $SLATEKIT_CLI/slatekit.bat
cp -R $SLATEKIT_REL/lib $SLATEKIT_CLI/
cp $SLATEKIT_HOME/src/lib/kotlin/slatekit/src/main/resources/*.conf $SLATEKIT_CLI/conf/
cp -R $SLATEKIT_HOME/src/lib/kotlin/slatekit/src/main/resources/templates $SLATEKIT_CLI/
cp $KIIT_REL/bin/kiit $KIIT_CLI/kiit
cp $KIIT_REL/bin/kiit.bat $KIIT_CLI/kiit.bat
cp -R $KIIT_REL/lib $KIIT_CLI/
cp $KIIT_HOME/src/lib/kotlin/kiit/src/main/resources/*.conf $KIIT_CLI/conf/
cp -R $KIIT_HOME/src/lib/kotlin/kiit/src/main/resources/templates $KIIT_CLI/


File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ task info {

// https://www.anexinet.com/blog/six-ways-to-package-a-java-application-with-gradle/
// gradle build distZip
mainClassName = 'slatekit.RunKt'
mainClassName = 'kiit.RunKt'

sourceSets {
main.java.srcDirs += 'src/main/kotlin/'
Expand All @@ -163,14 +163,14 @@ sourceSets {
}
}

jar {
manifest {
attributes(
'Main-Class': 'slatekit.RunKt',
"Class-Path": configurations.compile.collect { it.getName() }.join(' ')
)
}
}
//jar {
// manifest {
// attributes(
// 'Main-Class': 'kiit.RunKt',
// "Class-Path": configurations.compile.collect { it.getName() }.join(' ')
// )
// }
//}

task copyAllJars(type: Copy) {
dependsOn build
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'slatekit'
rootProject.name = 'kiit'

include ':slatekit-result'
project(':slatekit-result').projectDir=new File('../slatekit-result')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mantra: Simplicity above all else
* Created by kishorereddy on 5/19/17.
*/

package slatekit.tools
package kiit.tools


object Consts {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit
package kiit

import slatekit.apis.support.Authenticator
import slatekit.app.App
Expand All @@ -20,10 +20,10 @@ import slatekit.results.Success
import slatekit.serialization.Serialization
import slatekit.results.Failure

class SlateKit(ctx: Context) : App<Context>(ctx, AppOptions(showWelcome = false, showDisplay = false, showSummary = false)), SlateKitServices {
class Kiit(ctx: Context) : App<Context>(ctx, AppOptions(showWelcome = false, showDisplay = false, showSummary = false)), KiitServices {

private lateinit var settingsConf: Conf
private val setup = Setup(SlateKit::class.java, ctx)
private val setup = Setup(Kiit::class.java, ctx)
private val help = Help(TITLE)

companion object {
Expand Down Expand Up @@ -61,7 +61,7 @@ class SlateKit(ctx: Context) : App<Context>(ctx, AppOptions(showWelcome = false,
*/
val encryptor = Encryptor("aksf2409bklja24b", "k3l4lkdfaoi97042", B64Java8)

const val TITLE = "Slate Kit CLI"
const val TITLE = "Kiit CLI"

fun log(about: About, logger: Logger){
val folders = Folders.userDir(about)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package slatekit
package kiit

import slatekit.apis.SetupType
import slatekit.apis.routes.Api
import slatekit.apis.tools.code.CodeGenApi
import slatekit.common.conf.Conf
import slatekit.context.Context
import slatekit.docs.DocApi
import kiit.docs.DocApi
import slatekit.generator.*

interface SlateKitServices {
interface KiitServices {

val ctx: Context

fun apis(settings:Conf): List<Api> {
// APIs
val toolSettings = ToolSettings(settings.getString("slatekit.version"), settings.getString("slatekit.version.beta"), "logs/logback.log")
val toolSettings = ToolSettings(settings.getString("kiit.version"), settings.getString("kiit.version.beta"), "logs/logback.log")
val buildSettings = BuildSettings(settings.getString("kotlin.version"))
val logger = ctx.logs.getLogger("gen")
return listOf(
Api(GeneratorApi(ctx, GeneratorService(ctx, settings, SlateKit::class.java, GeneratorSettings(toolSettings, buildSettings), logger = logger)), declaredOnly = true, setup = SetupType.Annotated),
Api(GeneratorApi(ctx, GeneratorService(ctx, settings, Kiit::class.java, GeneratorSettings(toolSettings, buildSettings), logger = logger)), declaredOnly = true, setup = SetupType.Annotated),
Api(DocApi(ctx), declaredOnly = true, setup = SetupType.Annotated),
Api(CodeGenApi(), declaredOnly = true, setup = SetupType.Annotated)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit
package kiit

// Ktor
import io.ktor.application.ApplicationCall
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit.docs
package kiit.docs

data class Doc(
val name: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit.docs
package kiit.docs

import slatekit.apis.Api
import slatekit.apis.Action
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit.docs
package kiit.docs

object DocConstants {
val header = "doc:header"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit.docs
package kiit.docs

import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slatekit.docs
package kiit.docs

import slatekit.common.*
import slatekit.utils.writer.ConsoleWriter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package slatekit
package kiit

import kotlinx.coroutines.*
import slatekit.app.AppRunner
import slatekit.common.args.Args
import slatekit.common.io.Alias
import slatekit.common.log.LogsDefault
import slatekit.utils.writer.ConsoleWriter
import slatekit.context.AppContext
import slatekit.context.Context
import slatekit.generator.Help
import slatekit.providers.logback.LogbackLogs
import slatekit.results.Failure
Expand Down Expand Up @@ -56,7 +54,7 @@ import slatekit.results.Success
*/
fun main(args: Array<String>) {
val parsed = Args.parseArgs(args)
val help = Help(SlateKit.TITLE)
val help = Help(Kiit.TITLE)
val writer = ConsoleWriter()
when(parsed) {
is Success -> {
Expand All @@ -65,8 +63,8 @@ fun main(args: Array<String>) {
help.show()
}
else {
//run(args)
api(args)
run(args)
//api(args)
}
}
is Failure -> {
Expand All @@ -88,7 +86,7 @@ fun api(args: Array<String>) {

fun run(args:Array<String>){
/**
* DOCS : https://www.slatekit.com/arch/app/
* DOCS : https://www.kiit.dev/arch/app/
*
* NOTES: The AppRunner does the following:
*
Expand All @@ -101,15 +99,15 @@ fun run(args:Array<String>){
*/
runBlocking {
AppRunner.run(
cls = SlateKit::class.java,
cls = Kiit::class.java,
rawArgs = args,
about = SlateKit.about,
schema = SlateKit.schema,
enc = SlateKit.encryptor,
about = Kiit.about,
schema = Kiit.schema,
enc = Kiit.encryptor,
logs = LogbackLogs(),
hasAction = true,
source = Alias.Jar,
builder = { ctx -> SlateKit(ctx) }
builder = { ctx -> Kiit(ctx) }
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ env = loc
# qa = env.qa1.conf ( qa testing )
# loc = env.loc.conf ( local dev )
# pro = env.pro.conf ( production )
app.id = slatekit.tools
app.company = SlateKit
app.id = kiit.tools
app.company = kiit
app.area = tools
app.name = cli
app.desc = Tools app for various setup actions
app.region = ny
app.version = 1.1.0
app.url = http://sampleapp.slatekit.com
app.dir = slatekit
app.dir = kiit
app.group = Samples
app.contact = [email protected]
app.tags = slate,shell,cli
app.examples = sampleapp -env=dev -log.level=debug -region='ny' -enc=false

slatekit.tag = "v2"
slatekit.version = 2.8.0
slatekit.version.beta = 2.8.0
slatekit.version.cli = 2.8.0
kiit.tag = "v2"
kiit.version = 2.8.0
kiit.version.beta = 2.8.0
kiit.version.cli = 2.8.0
kotlin.version = 1.6.20
generation.source = usr://slatekit/generator/templates
generation.output = usr://slatekit/generator/gen
Expand All @@ -55,7 +55,7 @@ log.level = info

# DB Settings
db = true
db.location = user://.slatekit/conf/db.conf
db.location = user://.kiit/conf/db.conf


# All the ApiLogin files should be setup as property files like below
Expand All @@ -68,18 +68,18 @@ db.location = user://.slatekit/conf/db.conf

# Email
email = true
email.location = user://.slatekit/conf/email.conf
email.location = user://.kiit/conf/email.conf


# Sms
sms = true
sms.location = user://.slatekit/conf/sms.conf
sms.location = user://.kiit/conf/sms.conf

# File
files = false
files.location = user://.slatekit/conf/files.conf
files.location = user://.kiit/conf/files.conf


# Email
queues = false
queues.location = user://.slatekit/conf/queues.conf
queues.location = user://.kiit/conf/queues.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"description": "Generates a slatekit.app console application",
"description": "Generates a kiit.app console application",
"version": "1.28.0",
"url": "https://www.slatekit.com",
"contact": "https://www.slatekit.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import java.nio.file.Paths

buildscript {
ext.kotlin_version = '${build.kotlin.version}'
ext.slatekit_version = "${build.slatekit.version}"
ext.slatekit_version_beta = "${build.slatekit.version.beta}"
ext.slatekit_version = "${build.kiit.version}"
ext.slatekit_version_beta = "${build.kiit.version.beta}"
ext.ktor_version = '1.6.8'

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext.kotlin_version = '${build.kotlin.version}'
ext.slatekit_version = "${build.slatekit.version}"
ext.slatekit_version_beta = "${build.slatekit.version.beta}"
ext.slatekit_version = "${build.kiit.version}"
ext.slatekit_version_beta = "${build.kiit.version.beta}"

repositories {
jcenter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext.kotlin_version = '${build.kotlin.version}'
ext.slatekit_version = "${build.slatekit.version}"
ext.slatekit_version_beta = "${build.slatekit.version.beta}"
ext.slatekit_version = "${build.kiit.version}"
ext.slatekit_version_beta = "${build.kiit.version.beta}"

repositories {
jcenter()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext.kotlin_version = '${build.kotlin.version}'
ext.slatekit_version = "${build.slatekit.version}"
ext.slatekit_version_beta = "${build.slatekit.version.beta}"
ext.slatekit_version = "${build.kiit.version}"
ext.slatekit_version_beta = "${build.kiit.version.beta}"

repositories {
jcenter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext.kotlin_version = '${build.kotlin.version}'
ext.slatekit_version = "${build.slatekit.version}"
ext.slatekit_version_beta = "${build.slatekit.version.beta}"
ext.slatekit_version = "${build.kiit.version}"
ext.slatekit_version_beta = "${build.kiit.version.beta}"

repositories {
jcenter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import slatekit.providers.logback.LogbackLogs
*/
fun main(args: Array<String>) {
/**
* DOCS : https://www.slatekit.com/arch/app/
* DOCS : https://www.kiit.dev/arch/app/
*
* NOTES: The AppRunner does the following:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data class AppContext(
conf = conf,
logs = LogsDefault,
info = Info.none,
dirs = Folders.userDir("slatekit", name.toIdent(), name.toIdent())
dirs = Folders.userDir("kiit", name.toIdent(), name.toIdent())
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ class Creator(val context: Context, val ctx: GeneratorContext, val template: Tem
.replace("\${app.url}", ctx.name)
.replace("\${app.company}", ctx.company)
.replace("\${app.area}", ctx.area)
.replace("\${build.slatekit.version}", ctx.settings.tool.slatekitVersion)
.replace("\${build.slatekit.version.beta}", ctx.settings.tool.slatekitVersionBeta)
.replace("\${build.kiit.version}", ctx.settings.tool.slatekitVersion)
.replace("\${build.kiit.version.beta}", ctx.settings.tool.slatekitVersionBeta)
.replace("\${build.kotlin.version}", ctx.settings.build.kotlinVersion)
return converted
}
Expand Down
Loading

0 comments on commit dd9271e

Please sign in to comment.