Skip to content

Commit

Permalink
Merge pull request #10 from wordpress-mobile/update-project-apis
Browse files Browse the repository at this point in the history
Upgrade gradle and project dependencies
  • Loading branch information
mkevins authored Aug 10, 2023
2 parents 6fb9e4d + dc678fd commit 6fd4e2d
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 212 deletions.
2 changes: 2 additions & 0 deletions WordPressLint/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/build
lint-report.html
lint-results.txt
68 changes: 25 additions & 43 deletions WordPressLint/build.gradle
Original file line number Diff line number Diff line change
@@ -1,53 +1,35 @@
buildscript {
ext.kotlin_version = '1.3.72'

repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.novoda:bintray-release:0.9.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
version = "2.0.0"

apply plugin: 'java-library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'kotlin'

version = "1.0.2"
def lint_version = "26.3.2"
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'com.android.lint'

repositories {
google()
jcenter()
lint {
htmlReport true
htmlOutput file("lint-report.html")
textReport true
absolutePaths false
ignoreTestSources true
}

dependencies {
compileOnly "com.android.tools.lint:lint-api:$lint_version"
compileOnly "com.android.tools.lint:lint-checks:$lint_version"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation "com.android.tools.lint:lint:$lint_version"
testImplementation "com.android.tools.lint:lint-tests:$lint_version"
testImplementation "com.android.tools:testutils:$lint_version"
}
compileOnly "com.android.tools.lint:lint-api:$lintVersion"

jar {
manifest {
attributes("Lint-Registry-v2": "org.wordpress.android.lint.WordPressIssueRegistry")
}
testImplementation "junit:junit:4.13.2"
testImplementation "com.android.tools.lint:lint-tests:$lintVersion"
}

publish {
artifactId = 'lint'
userOrg = 'wordpress-mobile'
groupId = 'org.wordpress'
uploadName = 'lint'
desc = 'Lint module for WordPress-Android'
publishVersion = project.version
licences = ['GPL-2.0']
website = 'https://github.com/wordpress-mobile/WordPress-Lint-Android'
dryRun = 'false'
autoPublish = 'true'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

publishing {
publications {
maven(MavenPublication) {
from components.java

groupId = 'org.wordpress'
artifactId = 'lint'
version = project.version
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.wordpress.android.lint

import com.android.tools.lint.client.api.IssueRegistry
import com.android.tools.lint.client.api.Vendor
import com.android.tools.lint.detector.api.CURRENT_API
import org.wordpress.android.lint.WordPressAndroidImportInViewModelDetector.Companion.ISSUE_ANDROID_IMPORT_IN_VIEWMODEL

class WordPressIssueRegistry : IssueRegistry() {
override val api = CURRENT_API
override val minApi = MIN_API
override val issues get() = listOf(
WordPressRtlCodeDetector.SET_PADDING,
WordPressRtlCodeDetector.SET_MARGIN,
WordPressRtlCodeDetector.GET_PADDING,
ISSUE_ANDROID_IMPORT_IN_VIEWMODEL,
)
override val vendor = Vendor(
vendorName = "WordPress Android",
feedbackUrl = "https://github.com/wordpress-mobile/WordPress-Lint-Android/issues",
identifier = "org.wordpress.android.lint",
)
companion object {
const val MIN_API = 10
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.wordpress.android.lint.WordPressIssueRegistry
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class WordPressAndroidApiInViewModelDetectorTest {
lateinit var textView: TextView
}
""").indented())
.allowCompilationErrors()
.issues(ISSUE_ANDROID_IMPORT_IN_VIEWMODEL)
.run()
.expect("src/test/TestViewModel.kt:2: Error: ViewModels shouldn't " +
Expand All @@ -38,6 +39,7 @@ class WordPressAndroidApiInViewModelDetectorTest {
class TestViewModel : ViewModel()
""").indented())
.allowCompilationErrors()
.issues(ISSUE_ANDROID_IMPORT_IN_VIEWMODEL)
.run()
.expectClean()
Expand Down
29 changes: 29 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
buildscript {
ext {
kotlinVersion = '1.8.21'
agpVersion = '8.1.0'
lintVersion = '31.1.0'
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:$agpVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}

}

plugins {
id 'maven-publish'
}

allprojects {
repositories {
google()
mavenCentral()
}
}
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 @@
#Thu Feb 22 17:53:41 JST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Loading

0 comments on commit 6fd4e2d

Please sign in to comment.