Skip to content

Commit

Permalink
Merge pull request #34 from abema/yuki/gradle-agp-upgradle
Browse files Browse the repository at this point in the history
upgrade gradle and agp
  • Loading branch information
YukiMatsumura authored Nov 19, 2024
2 parents a956d4e + aaf621d commit 2ab336d
Show file tree
Hide file tree
Showing 19 changed files with 222 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lintIssues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: lint
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: Test
on: [push]
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- uses: actions/checkout@v3
- name: test
run: ./gradlew test
- name: sample lint
run: ./gradlew :sample-android:lintDebug
107 changes: 3 additions & 104 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,107 +1,9 @@
# Created by https://www.toptal.com/developers/gitignore/api/gradle,intellij
# Edit at https://www.toptal.com/developers/gitignore?templates=gradle,intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
modules.xml
.idea/misc.xml

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
# Intellij project files
.idea/
!.idea/kotlinc.xml

### Gradle ###
.gradle
Expand All @@ -126,9 +28,6 @@ gradle-app.setting
/lint-results.sarif

# Other
.idea/vcs.xml
local.properties
.idea/kotlinScripting.xml
.idea/deploymentTargetDropDown.xml

# End of https://www.toptal.com/developers/gitignore/api/gradle,intellij
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 31 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
buildscript {
ext {
lintVersion = '31.0.2'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
classpath 'com.android.tools.build:gradle:7.4.2'
ext {
lintVersion = '31.7.2'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21'
classpath 'com.android.tools.build:gradle:8.7.2'
}
}
allprojects {
repositories {
google()
mavenCentral()
}

// Added this block:
afterEvaluate { project ->
if (project.hasProperty("kotlin")) {
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "11"
}
}
}
}
}
subprojects {
repositories {
google()
mavenCentral()
}
repositories {
google()
mavenCentral()
}
}
7 changes: 6 additions & 1 deletion flagfit-flagtype/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ apply plugin: 'kotlin'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api project(":flagfit")
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0'
testImplementation 'junit:junit:4.13.2'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
7 changes: 6 additions & 1 deletion flagfit-lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api project(":flagfit")
api project(":flagfit-flagtype")
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0'
compileOnly "com.android.tools.lint:lint-api:$lintVersion"
compileOnly "com.android.tools.lint:lint-checks:$lintVersion"
testImplementation 'junit:junit:4.13.2'
Expand All @@ -18,3 +18,8 @@ jar {
attributes 'Lint-Registry-v2': 'tv.abema.flagfit.IssueRegistry'
}
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ class FlagTypeExpiryDateIllegalParamDetector : Detector(), SourceCodeScanner {
}
if (expiryDate == FlagType.EXPIRY_DATE_NOT_DEFINED) return
if (!isDateFormatValid(expiryDate)) {
val message = "The value of expireDate is not in the correct date format.\n" +
"Please set the expiration date in the following format: \"yyyy-mm-dd\""
val message =
"The value of expireDate is not in the correct date format. (expiryDate=$expiryDate)\n" +
"Please set the expiration date in the following format: \"yyyy-mm-dd\""
context.report(ISSUE_ILLEGAL_DATE, element, location, message)
}
}
Expand All @@ -65,8 +66,9 @@ class FlagTypeExpiryDateIllegalParamDetector : Detector(), SourceCodeScanner {
) {
when (qualifiedName) {
AnnotationPackagePath.PACKAGE_PATH_WIP, AnnotationPackagePath.PACKAGE_PATH_EXPERIMENT -> {
val message = "`EXPIRY_DATE_INFINITE` cannot be set for the expireDate of `@FlagType.WorkInProgress` and `@FlagType.Experiment`.\n" +
"Please set the expiration date in the following format: \"yyyy-mm-dd\""
val message =
"`EXPIRY_DATE_INFINITE` cannot be set for the expireDate of `@FlagType.WorkInProgress` and `@FlagType.Experiment`.\n" +
"Please set the expiration date in the following format: \"yyyy-mm-dd\""
context.report(ISSUE_ILLEGAL_EXPIRY_DATE_INFINITE_PARAM, element, location, message)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
"""
src/foo/Example.kt:10: Warning: The @FlagType.Experiment created by owner: Hoge Fuga has expired!
Please consider deleting @FlagType.Experiment as the expiration date has passed on 2023-06-01.
The flag of key: "new-awesome-feature" is used in the awesomeExperimentFeatureEnabled function.
[FlagfitDeadlineExpired]
The flag of key: "new-awesome-feature" is used in the awesomeExperimentFeatureEnabled function. [FlagfitDeadlineExpired]
@FlagType.Experiment(
^
0 errors, 1 warnings
Expand Down Expand Up @@ -104,8 +103,7 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
"""
src/foo/Example.kt:10: Warning: The @FlagType.Experiment owner: Hoge Fuga will expire soon!
Please consider deleting @FlagType.Experiment as the expiry date of 2023-06-01 is scheduled to pass within a week.
The flag of key: "new-awesome-feature" is used in the awesomeExperimentFeatureEnabled function.
[FlagfitDeadlineSoon]
The flag of key: "new-awesome-feature" is used in the awesomeExperimentFeatureEnabled function. [FlagfitDeadlineSoon]
@FlagType.Experiment(
^
0 errors, 1 warnings
Expand Down Expand Up @@ -233,8 +231,7 @@ class DeadlineExpiredDetectorText : LintDetectorTest() {
"""
src/foo/Example.kt:10: Warning: The @FlagType.Experiment created by owner: Hoge Fuga has expired!
Please consider deleting @FlagType.Experiment as the expiration date has passed on 2023-06-01.
The flag of key: "new-awesome-feature" is used in the awesomeVariationFeatureEnabled function.
[FlagfitDeadlineExpired]
The flag of key: "new-awesome-feature" is used in the awesomeVariationFeatureEnabled function. [FlagfitDeadlineExpired]
@FlagType.Experiment(
^
0 errors, 1 warnings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class FlagTypeExpiryDateIllegalParamDetectorText : LintDetectorTest() {
.run()
.expect(
"""
src/foo/Example.kt:12: Error: The value of expireDate is not in the correct date format.
src/foo/Example.kt:12: Error: The value of expireDate is not in the correct date format. (expiryDate=2023-12-100)
Please set the expiration date in the following format: "yyyy-mm-dd" [FlagfitIllegalDate]
@FlagType.Ops(
^
Expand Down
7 changes: 6 additions & 1 deletion flagfit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ apply plugin: 'kotlin'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0'
testImplementation 'junit:junit:4.13.2'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri May 26 17:19:13 JST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 2ab336d

Please sign in to comment.