Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle plugin #4

Open
ZakTaccardi opened this issue Sep 4, 2016 · 2 comments
Open

Gradle plugin #4

ZakTaccardi opened this issue Sep 4, 2016 · 2 comments

Comments

@ZakTaccardi
Copy link

This should be a gradle plugin!

@shivan42
Copy link
Owner

shivan42 commented Sep 4, 2016

May be...
If you see this project as gradle plugin and have a time to create this plugin, my project is open for improvements !

@nayeemzen
Copy link

nayeemzen commented Jun 13, 2017

Simple gradle task to generate sql entities in the build folder and add them to the classpath.

All your sql files go in src/main/sql
CodeGenUnderStorIO.jar is in app/codegen

def sqlPath = 'src/main/sql'
def sqlGeneratedPath = 'build/generated/source/sql/'
android {
    sourceSets {
        main.java.srcDirs += sqlGeneratedPath
    }
}
task generateStorIOEntities {
    description = 'Generate sqlite tables and storio entities'
    fileTree(dir: sqlPath, include: '**/*.sql').each { File file ->
        doLast {
            javaexec {
                main = "-jar";
                classpath = buildscript.configurations.classpath
                args = ["codegen/CodeGenUnderStorIO.jar", "${file}", "com.sendkoin.sql", "${sqlGeneratedPath}"]
            }
        }
    }
}

preBuild.dependsOn generateStorIOEntities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants