Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure incremental compilation and JVM options to improve build time.
Change-Id: Iebd9df6ca26736b383b2c38f50caab530144ec78 Closes-Bug: #1770567
- Loading branch information
1 parent
993487b
commit 418d862
Showing
17 changed files
with
155 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-Xms1024m -Xmx2048m -XX:+TieredCompilation -XX:TieredStopAtLevel=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -T 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
o11nplugin-contrail-custom/src/main/kotlin/net/juniper/contrail/vro/CustomCodeGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package net.juniper.contrail.vro | ||
|
||
import com.vmware.o11n.sdk.modeldrivengen.code.CodeGeneratorConfig | ||
import com.vmware.o11n.sdk.modeldrivengen.code.DefaultCodeGeneratorConfig | ||
import com.vmware.o11n.sdk.modeldrivengen.code.DefaultPluginCodeGenerator | ||
import com.vmware.o11n.sdk.modeldrivengen.code.DefaultRuntimeConfigurationGenerator | ||
import com.vmware.o11n.sdk.modeldrivengen.code.PluginCodeGenerator | ||
import com.vmware.o11n.sdk.modeldrivengen.code.RuntimeConfigurationGenerator | ||
import com.vmware.o11n.sdk.modeldrivengen.mapping.AbstractMapping | ||
import com.vmware.o11n.sdk.modeldrivengen.model.Plugin | ||
import net.juniper.contrail.vro.config.packageToPath | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class CustomCodeGenerator @Inject constructor( | ||
private val codeDelegate: DefaultPluginCodeGenerator, | ||
private val configDelegate: DefaultRuntimeConfigurationGenerator, | ||
config: CodeGeneratorConfig, | ||
mapping: AbstractMapping | ||
) : PluginCodeGenerator, RuntimeConfigurationGenerator { | ||
private val generate: Boolean = generationRequired(config, mapping) | ||
|
||
init { | ||
if (!generate && config is DefaultCodeGeneratorConfig) | ||
config.isVerbose = false | ||
} | ||
|
||
private fun generationRequired(config: CodeGeneratorConfig, mapping: AbstractMapping): Boolean { | ||
val vsoXmlPath = Paths.get(config.javaOutputDir.absolutePath, config.basePackage.packageToPath(), "runtime-config.properties") | ||
if (! Files.exists(vsoXmlPath)) return true | ||
val mappingPath = Paths.get(mapping.javaClass.protectionDomain.codeSource.location.toURI()) | ||
val vsoTime = Files.getLastModifiedTime(vsoXmlPath) | ||
val mappingTime = Files.getLastModifiedTime(mappingPath) | ||
return mappingTime > vsoTime | ||
} | ||
|
||
override fun generateJavaCode(mapping: AbstractMapping, plugin: Plugin) { | ||
if (generate) | ||
codeDelegate.generateJavaCode(mapping, plugin) | ||
else | ||
println("[INFO] Skipped generation of wrapper classes.") | ||
} | ||
|
||
override fun generateRuntimeConfiguration(mapping: AbstractMapping, plugin: Plugin) { | ||
if (generate) | ||
configDelegate.generateRuntimeConfiguration(mapping, plugin) | ||
else | ||
println("[INFO] Skipped generation of runtime configuration.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.