@appshuttle.io/turing
Version:
Code Generation Library used in Shuttle
62 lines (52 loc) • 2.17 kB
JavaScript
class BuildGradleAppTemplates {
constructor() {
/*
BuildGradleApp STRUCTURE START
*/
// BuildGradleApp Structure Defaults
this.MIN_SDK_DEFAULT = '16'
this.TARGET_SDK_DEFAULT = '26'
this.VERSION_CODE_DEFAULT = '1'
this.VERSION_NAME_DEFAULT = '1'
// BuildGradleApp Structure Holders
this.NAME_HOLDER = '%name%'
this.MIN_SDK_HOLDER = '%minSdk%'
this.TARGET_SDK_HOLDER = '%targetSdk%'
this.VERSION_CODE_HOLDER = '%versionCode%'
this.VERSION_NAME_HOLDER = '%versionName%'
this.getBuildGradleAppStructure = function () {
return `
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.appshuttle.`+this.NAME_HOLDER+`"
minSdkVersion `+ this.MIN_SDK_HOLDER+`
targetSdkVersion `+ this.TARGET_SDK_HOLDER + `
versionCode ` + this.VERSION_CODE_HOLDER + `
versionName "` + this.VERSION_NAME_HOLDER + `"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
`
}
/*
BuildGradleApp STRUCTURE END
*/
}
}
module.exports = BuildGradleAppTemplates