Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v3
- name: Gradle Assemble
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v3
- name: Gradle Test
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v3
- name: Gradle Codenarc
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For more information about the Protobuf Compiler, please refer to
[Google Developers Site](https://developers.google.com/protocol-buffers/docs/reference/java-generated?csw=1).

## Latest Version
The latest version is ``0.9.6``. It requires at least __Gradle 5.6__ and __Java 8__.
The latest version is ``0.9.6``. It requires at least __Gradle 8.9__ and __Java 17__.
To use it with Groovy DSL:
```gradle
plugins {
Expand Down
51 changes: 24 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id 'codenarc'
id 'idea'
id 'eclipse'
id 'groovy'
id 'maven'
id 'maven-publish'
id 'signing'

id "com.github.ben-manes.versions" version "0.12.0"
id "com.gradle.plugin-publish" version "0.11.0"
id "org.gradle.kotlin.kotlin-dsl" version "1.4.9"
id "com.github.ben-manes.versions" version "0.51.0"
id "com.gradle.plugin-publish" version "1.2.1"
id "org.gradle.kotlin.kotlin-dsl" version "4.4.0"
}

group = 'com.google.protobuf'
Expand All @@ -28,13 +29,15 @@ configurations {
}

dependencies {
compileOnly "com.android.tools.build:gradle:4.1.0"
compileOnly "org.jetbrains.kotlin.android:org.jetbrains.kotlin.android.gradle.plugin:1.7.22"
compileOnly "com.android.tools.build:gradle-api:8.7.3"
compileOnly "com.android.tools.build:builder-test-api:8.7.3"
compileOnly "com.android.tools:repository:32.0.0"
compileOnly "com.android.tools.analytics-library:protos:32.0.0"

implementation 'com.google.gradle:osdetector-gradle-plugin:1.7.3'

testImplementation 'junit:junit:4.12'
testImplementation('org.spockframework:spock-core:1.0-groovy-2.4') {
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
exclude module: 'groovy-all'
}
testImplementation 'commons-io:commons-io:2.5'
Expand All @@ -47,24 +50,24 @@ java {

tasks.register('groovydocJar', Jar) {
dependsOn groovydoc
classifier = 'groovydoc'
archiveClassifier = 'groovydoc'
from groovydoc.destinationDir
}

codenarc {
toolVersion = "1.4"
toolVersion = "3.4.0"
if (System.env.CI == 'true') {
// Normally html output is more user friendly,
// but we want a console printable file for CI logs
reportFormat = 'text'
}
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

tasks.withType(GenerateModuleMetadata) {
enabled = false
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}

File testRepoUrl = layout.buildDirectory.dir('testRepo').get().asFile
Expand Down Expand Up @@ -129,28 +132,20 @@ if (!gradle.startParameter.taskNames.intersect(['publishPlugins'])) {
}

gradlePlugin {
website = 'https://github.com/google/protobuf-gradle-plugin'
vcsUrl = 'https://github.com/google/protobuf-gradle-plugin'
plugins {
protobufPlugin {
id = "com.google.protobuf"
implementationClass = "com.google.protobuf.gradle.ProtobufPlugin"
displayName = 'Protobuf Plugin for Gradle'
description = "The Protobuf plugin provides protobuf compilation to your project."
tags = ['protobuf', 'protocol-buffers', 'protoc']
}
}
}

pluginBundle {
website = 'https://github.com/google/protobuf-gradle-plugin'
vcsUrl = 'https://github.com/google/protobuf-gradle-plugin'
description = 'The Protobuf plugin provides protobuf compilation to your project.'

plugins {
protobufPlugin {
id = 'com.google.protobuf'
displayName = 'Protobuf Plugin for Gradle'
tags = ['protobuf', 'protocol-buffers', 'protoc']
}
}
}

// Required in order to support building a mixed kotlin/groovy project. With out this,
// we would get a cyclic dependency error, since both compileKotlin and compileGroovy
Expand All @@ -159,8 +154,8 @@ pluginBundle {
tasks.named('compileGroovy') {
classpath = sourceSets.main.compileClasspath
}
tasks.named('compileKotlin') {
compileKotlin.classpath += files(compileGroovy.destinationDirectory)
tasks.withType(KotlinCompile).configureEach {
libraries.from(files(tasks.named('compileGroovy').get().destinationDirectory))
}

tasks.named('test') {
Expand Down Expand Up @@ -189,6 +184,8 @@ tasks.named('test') {
events = ["standard_out", "standard_error", "started", "passed", "failed", "skipped"]
}

useJUnitPlatform()

// Hack for gradle runner test classloader.
//
// GradleRunner.withPluginClasspath method loads a plugin under test to the classloader_1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading