How can I change the appengineplugin destination directory and perform live reloading?

27 Views Asked by At

enter image description here

This is my project structure. I have my java classes in the src folder and frontend js, css etc in the war folder. This is my build.gradle file

 buildscript {
  repositories {
    mavenCentral()
  }

  dependencies {
    classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.4.4'
  }
}
repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

apply plugin: 'com.google.cloud.tools.appengine-appenginewebxml'

sourceSets {
    main {
        java.srcDirs = ['../']
    }
}

dependencies {
    implementation fileTree(dir: '/Users/sharon/Documents/Lily/war/WEB-INF/lib', include: ['*.jar'])
    implementation 'com.google.guava:guava:31.1-jre'
}

ext.getAppVersion = { ->
    return project.property('version')
}

appengine {
    tools {
        cloudSdkVersion = '449.0.0'
    }
    run {
        // ./gradlew appengineStart (to run the app locally)
        // ./gradlew appengineStop
        jvmFlags = ['-Dappengine.fullscan.seconds=5']
        projectId= 'beta-v2'
        services = '../war'
        port = 8080
        automaticRestart = true
    }
}

war {
    duplicatesStrategy = 'exclude'
}

//  ./gradlew deploy -Pversion=talktime
task deploy {
    doLast {
        def versionName = getAppVersion()
        exec {
            commandLine 'gcloud', 'app', 'deploy', '--quiet', '../war/WEB-INF/appengine-web.xml', '--version=' + versionName, '--no-promote'
        }
    }
}

when I do ./gradlew appengineRun, the java classes are compiled into the build folder. since appengine looks for files in the war folder, and the compiled classes are in build folder, no changes are reflected. how can I automate the process of copying it to the war folder. Frontend changes are refreshed without any problem. And is there any way I can automate recompile java classes for every file change

0

There are 0 best solutions below