@@ -16,11 +16,11 @@ object AzureFunctionsKeys {
1616 val azfunHostJsonFile =
1717 settingKey[File ](" Location of the host.json file" )
1818 val azfunJarName =
19- settingKey[String ](" Name of the jar that holds the function definitions (without extension )" )
19+ settingKey[String ](" Name of the jar that holds the function definitions (default: AzureFunction.jar )" )
2020 val azfunLocalSettingsFile =
2121 settingKey[File ](" Location of the local.settings.json" )
2222 val azfunZipName =
23- settingKey[String ](" Name of the zip file that will contain the results (without extension )" )
23+ settingKey[String ](" Name of the zip file that will contain the results (default: AzureFunction.zip )" )
2424
2525 val azfunCreateZipFile = taskKey[File ](
2626 " Generate the zip file containing the complete Azure Function definition"
@@ -50,7 +50,8 @@ object AzureFunctions extends AutoPlugin {
5050 azfunHostJsonFile := (baseDirectory in Compile ).value / " host.json" ,
5151 azfunLocalSettingsFile := (baseDirectory in Compile ).value / " local.settings.json" ,
5252 azfunTargetFolder := (target in Compile ).value / azfunZipName.value,
53- azfunZipName := " AzureFunction" ,
53+ azfunZipName := " AzureFunction.zip" ,
54+ azfunJarName := " AzureFunction.jar" ,
5455 azfunCopyHostJson := {
5556 val log = sbt.Keys .streams.value.log
5657 val folder = azfunTargetFolder.value
@@ -105,23 +106,27 @@ object AzureFunctions extends AutoPlugin {
105106 )
106107
107108 val src = azfunTargetFolder.value
108- val tgt = tgtFolder / s " ${ azfunZipName.value} .zip "
109+ val tgt = tgtFolder / azfunZipName.value
109110 IO .zip(allSubpaths(src), tgt)
110111 tgt
111112 },
112113 azfunGenerateFunctionJsons := {
113114 // depend on assembly step
114- val _ = assembly.value
115+ val assemblyJar = assembly.value
115116 val log = sbt.Keys .streams.value.log
116117
117118 val folder = azfunTargetFolder.value
118119
119120 log.info(" Running azureFunctions task..." )
120121 log.info(s " Generating function.json files to $folder ... " )
121122
122- val fatJarFile = azfunTargetFolder.value / s " ${azfunJarName.value}.jar "
123- val urls =
124- ClasspathHelper .forManifest(fatJarFile.toURI.toURL).asScala.toList
123+ val fatJarFile = folder / azfunJarName.value
124+
125+ // copy the assembly jar into the folder that will be zipped eventually
126+ IO .copy(
127+ Seq ((assemblyJar, fatJarFile))
128+ )
129+ val urls = ClasspathHelper .forManifest(fatJarFile.toURI.toURL).asScala.toList
125130 val configs = FunctionConfigGenerator .getConfigs(urls)
126131
127132 val baseFolder = azfunTargetFolder.value
0 commit comments