tasks.register('generateKeystore') { group 'sign' description 'create jks' doFirst { def keytoolPath=project.property("sign.keytool.path") def keypass=project.property("sign.keytool.keypass") def keystore=project.property("sign.keytool.storepass") def dName=project.property("sign.keytool.dname") def appAlias=project.property("sign.keytool.appAlias") def keystorePath = "$project.project.projectDir.absolutePath\\app\\sign\\jxit.jks" exec { workingDir "." commandLine "$keytoolPath", "-genkey","-v", "-alias", appAlias, "-keyalg", "RSA", "-keypass", keypass, "-storepass", keystore, "-keystore", keystorePath, "-keysize" ,2048, "-validity", 30, "-dname",dName } } }