Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.
zerovian edited this page Jun 28, 2019 · 17 revisions

Quickstart Guide

To use this plugin locally:

  1. Clone this repository to your local filesystem via the command:

    • git clone https://github.com/dambenso/Progress-Grabl.git
  2. cd into the Progress-Grabl repository and run ./gradlew build

    • This will build up the jars of this plugin in Progress-Grabl/build/libs. The version number will the group name + the artifact id + the version number. This version number may change. if you don't know it, you can find it in the build.gradle file near the top.
    • ./gradlew build will build jars and run the unit tests. To simply build the jars, run ./gradlew assemble
  3. In your local filesystem, create a gradle standalone project.

    • This can be done by either running gradle init or by simply creating your own build.gradle in a directory.
  4. Add the folder containing the jars as a repository and add Progress-Grabl to your classpath by adding this code to your build.gradle:

buildscript {
    repositories {
        flatDir { dirs '../Progress-Grabl/build/libs/' }
    }
    dependencies {
        // Remember to replace this version number with your own version
        classpath "io.gitlab.grabl:grabl:0.2.0"
    }
}
    
allprojects {
    repositories {
        jcenter()
    }
}
    
apply plugin: 'io.gitlab.grabl.grabl'
  1. Now you can use the gradle tasks in that build.gradle, like so:
apply plugin: 'base'

// This sets some global variables to the plugin, such as propath and where 
// rcode is stored
abl { 
    propath = files('src')
    rcodeDir = 'build/rcode'
}
    
// This is a default task found in the original grabl project found here: https://grabl.gitlab.io/
compileAbl {
    source('src/abl')
    include('**/*.p')
    
    destinationDir = abl.rcodeDir
}
    
// This is a new task added in Progress-Grabl, all of its options match the PCT task
// PCTCreateDatabase (found here: https://github.com/Riverside-Software/pct/wiki/PCTCreateDatabase)
task createDb(type: io.gitlab.grabl.CreateDatabase) {
    dbName = "foofoo"
    destDir = "build"
    sourceDb = '/psc/120/dlc/sports2020.db'
    largeFiles = true
}

// This is a new task added in Progress-Grabl, all of its options match the PCT task
// PCTLibrary (found here: https://github.com/Riverside-Software/pct/wiki/PCTLibrary)
task createPL(type: io.gitlab.grabl.CreateProcedureLibrary) {
    destFile = 'this.pl'
    cpInternal = 'UTF-8'
    defaultExcludes = false
}

// This is a new task added in Progress-Grabl, all of its options match the PCT task
// PCTConnection (found here: https://github.com/Riverside-Software/pct/wiki/PCTConnection) 
// This creates a reusable DBConnection with the id 'foodb'
task createConnection(type: io.gitlab.grabl.DBConnection) {
    dbName = 'sports2020'
    dbDir = 'testdb/'
    id = 'foodb'
    singleUser = true
}

// This is a new task added in Progress-Grabl, all of its options match the PCT task
// PCTLoadSchema (found here: https://github.com/Riverside-Software/pct/wiki/PCTLoadSchema) 
// This example loads all schema files in a folder that ends with a .df into a database.
// This reuses the database connection of the task createConnection by referring to its id.
task loadSchema(type: io.gitlab.grabl.LoadSchema) {
    dependsOn createConnection

    source 'schema'
    include '*.df'

    refid = "foodb"
}