Android 3.0 とGradle 4.1 にあわせてbuild.gradleを調整した

This commit is contained in:
tateisu 2017-11-04 23:51:15 +09:00
parent ca759edfe1
commit 5c4663827d
5 changed files with 40 additions and 38 deletions

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
@ -27,17 +24,7 @@
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -1,16 +1,17 @@
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "jp.juggler.subwaytooter"
minSdkVersion 21
targetSdkVersion 26
versionCode 172
versionName "1.7.2"
versionCode 173
versionName "1.7.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
@ -21,27 +22,33 @@ android {
}
}
// Specifies comma-separated list of flavor dimensions.
flavorDimensions "rcOrDev"
productFlavors {
rc {
dimension "rcOrDev"
}
}
dexOptions {
jumboMode = true
}
// Generate Signed APK
applicationVariants.all { variant ->
android.applicationVariants.all { variant ->
if (variant.buildType.name == "release") {
variant.outputs.each { output ->
if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {
// Rename APK
def versionCode = defaultConfig.versionCode
def versionName = defaultConfig.versionName
def flavor = variant.flavorName
def date = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date())
def newName = "SubwayTooter-${flavor}-${versionCode}-${versionName}-${date}.apk"
output.outputFile = new File((String) output.outputFile.parent, (String) newName)
}
variant.outputs.all {
// Rename APK
def versionCode = defaultConfig.versionCode
def versionName = defaultConfig.versionName
def flavor = variant.flavorName
def date = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date())
outputFileName = "../../SubwayTooter-${flavor}-${versionCode}-${versionName}-${date}.apk"
}
}
}
}
dependencies {
@ -49,13 +56,13 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:customtabs:26.0.1'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.google.firebase:firebase-messaging:10.2.6'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
// compile 'com.android.support.constraint:constraint-layout:1.0.2'
@ -81,6 +88,10 @@ dependencies {
compile 'com.google.android:flexbox:0.3.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}

View File

@ -1,15 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion 21

View File

@ -1,6 +1,6 @@
#Sun Apr 16 06:58:46 JST 2017
#Sat Nov 04 23:32:32 JST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip