Compile error during compilation with javac | Groovy - groovy

Have an err with compiling gradle idea
error see on screen
http://upwap.ru/1884422
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'code-quality'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'project-reports'
sourceCompatibility = 1.6 archivesBaseName = 'opas-client'
ideaModule { downloadJavadoc = true }
buildscript {
repositories {
mavenRepo urls: "f:/dev/lib/"
}
}
version = '0.1'
gradle.taskGraph.whenReady {taskGraph ->
if (taskGraph.hasTask(':release')) {
version = '0.1.2' // } else { // version = '1.0.624'
}
}
repositories {
mavenRepo urls: "f:/dev/lib/"
}
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy-all', version: '1.7.5'
compile 'log4j:log4j:1.2.14',
'com.caucho:hessian:4.0.7',
'com.toedter:jcalendar:1.3.2',
'org.springframework:spring-context-support:3.0.5.RELEASE',
'org.springframework:spring-web:3.0.5.RELEASE',
'com.jgoodies:looks:2.2.2',
'com.jgoodies:animation:1.2.0',
'com.jgoodies:binding:2.0.6',
'com.jgoodies:forms:1.2.1',
'com.jgoodies:validation:2.0.1'
testCompile 'junit:junit:4.7',
'org.unitils:unitils-spring:3.1',
'org.unitils:unitils-easymock:3.1',
'org.unitils:unitils-inject:3.1',
'org.springframework:spring-test:3.0.5.RELEASE'
}
manifest.mainAttributes(
'Implementation-Title': 'victoria',
'Implementation-Version': version,
'Main-Class': 'com.sirius.opas.client.Client',
'Class-Path':manifestClasspath() )
task release(dependsOn: 'jar') << {
ant.delete(dir:releaseDir, quiet:"true" )
ant.mkdir(dir:releaseDir)
copy {
from configurations.compile
into "${releaseDir}/${releaseLibDir}"
}
copy {
from "$libsDir/${archivesBaseName}-${version}.jar"
from "dist/start.sh"
from "dist/start.cmd"
into "${releaseDir}"
}
}
String manifestClasspath() {
String classes = ""
configurations.compile.files.each { file ->
classes += " ${releaseLibDir}/${file.name}"
}
return classes
}

I think you are simply missing a dependency that provides BeanDefinition class. Try adding 'org.springframework:spring-beans:3.0.5.RELEASE' to your compile dependencies list.

Related

Failed to apply plugin [id 'org.gradle.checkstyle']?

How to solve this error?
Error:(24, 1) A problem occurred evaluating root project 'myproject10'.
Failed to apply plugin [id 'org.gradle.checkstyle']
Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().
subprojects {
def projectName = it.name
if (projectName != "graphql-java-support") {
apply from: "../gradle/dependencies.gradle"
}
buildscript {
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://maven.google.com' }
}
if (projectName != "graphql-java-support") {
apply plugin: 'checkstyle'
checkstyle {
toolVersion = "5.9"
configFile rootProject.file('checkstyle.xml')
configProperties = ['checkstyle.cache.file': rootProject.file('build/checkstyle.cache')]
ignoreFailures false
showViolations true
}
task checkstyle(type: Checkstyle) {
source 'src/main/java'
include '**/*.java'
classpath = files()
}
afterEvaluate {
if (project.tasks.findByName('check')) {
check.dependsOn('checkstyle')
}
}
}
}
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}

Android Studio Wikitude Native SDK Issue

So im trying to first build a basic app using android studio and Wikitudes Native SDK to make an AR app. After following the setup instructions ive ran into an error I cant seem to solve but have an idea of why/where its happening. Does anyone know what could be causing these errors?
This image here shows the errors I am getting and what looks to be an issue with a few of the imports
Here is also a copy of my build.gradle file (Module: app), and my build.gradle file (Module: NativeSDKExamples), respectively:
apply plugin: 'com.android.application'
android {
compileSdkVersion commonCompileSdkVersion
buildToolsVersion commonBuildToolsVersion
defaultConfig {
applicationId "com.uhg.ent.mobile.lifesciences.amplify"
minSdkVersion commonMinSdkVersion
targetSdkVersion commonTargetSdkVersion
versionCode 1
versionName "7.2.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = "app-" + variant.buildType.name + ".apk"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
flavorDimensions "arch"
productFlavors {
arm7 {
dimension "arch"
}
arm8 {
dimension "arch"
}
x86 {
dimension "arch"
}
allarchs {
dimension "arch"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile (name: 'wikitude-native-sdk', ext:'aar')
arm7Compile project(path: ':plugins', configuration: 'arm7Release')
arm8Compile project(path: ':plugins', configuration: 'arm8Release')
x86Compile project(path: ':plugins', configuration: 'x86Release')
allarchsCompile project(path: ':plugins', configuration: 'allarchsRelease')
compile "com.android.support:appcompat-v7:$commonSupportLibVersion"
compile "com.android.support:design:$commonSupportLibVersion"
compile "com.android.support:support-v4:$commonSupportLibVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android:flexbox:0.2.5'
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
AND
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
subprojects {
ext.commonCompileSdkVersion = 26
ext.commonBuildToolsVersion = "26.0.0"
ext.commonMinSdkVersion = 19
ext.commonTargetSdkVersion = 26
ext.commonSupportLibVersion = "26.0.0"
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

Cannot properly compile play services for libgdx

So I've been trying to add google play services for my game.
First thing I did was add the dependency to the gradle file. This is how it looks now:
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "My First Game"
gdxVersion = '1.9.3'
roboVMVersion = '2.1.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
googlePlayVersion = '9.4.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
compile "com.google.android.gms:play-services:$googlePlayVersion"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
}
}
tasks.eclipse.doLast {
delete ".project"
}
Here is a picture of the packages I have installed
However I still can't use the library and if I try to make for example an AdView (which I should now be able to) it goes red and can't be identified, however I can Alt+Enter to
Add library 'play-services-ads-lite-9.4.0' to classpath
If I add that, it adds the following line to the module (not project) gradle file:
compile 'com.google.android.gms:play-services-ads-lite:9.4.0'
and I get this gradle error.
If I go to:
/home/user/Android/Sdk/extras/google/m2repository/com/google/android
I can see the folders play-services, play-services-ads, etc, so I know they are there!
Thank you for taking the time to look into my problem. All help is appreciated!
EDIT: It has come to my attention that you might need the code: apply plugin: 'com.google.gms.google-services'.
I'm not sure where this should be however it says i need a file google-services.json. Not sure you should need this? Here is where i place the above line of code:
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
compile "com.google.android.gms:play-services:$googlePlayVersion"
}
apply plugin: 'com.google.gms.google-services'
}
EDIT2: if I try to put the dependency as well as the "apply plugin" in this file instead of the project gradle I get the same result in the fork of an error message saying that google-services.json is missing. This is my module android gradle:
android {
buildToolsVersion "23.0.2"
compileSdkVersion 23
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
defaultConfig {
applicationId "com.oscarboking.myfirstgame"
minSdkVersion 9
targetSdkVersion 23
}
}
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/arm64-v8a/").mkdirs();
file("libs/x86_64/").mkdirs();
file("libs/x86/").mkdirs();
configurations.natives.files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.oscarboking.myfirstgame/AndroidLauncher'
}
// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
// ignores any nodes added in classpath.file.withXml
sourceSets {
main {
java.srcDirs "src", 'gen'
}
}
jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
classpath {
plusConfigurations += [project.configurations.compile]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}
project {
name = appName + "-android"
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommands.clear();
buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
}
}
// sets up the Android Idea project, using the old Ant based build.
idea {
module {
sourceDirs += file("src");
scopes = [COMPILE: [plus: [project.configurations.compile]]]
iml {
withXml {
def node = it.asNode()
def builder = NodeBuilder.newInstance();
builder.current = node;
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value: "true")
}
}
}
}
}
}
}
dependencies {
compile "com.google.android.gms:play-services:9.4.0"
}
apply plugin: 'com.google.gms.google-services'
If I try to use anything in the library I can alt+enter to the dependency however it tries to add it to the core module gradle file.
I'm using classpath 'com.google.gms:google-services:2.0.0' in my project gradle and compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'
compile 'com.google.android.gms:play-services-games:8.4.0' in my android module gradle.
I'm also using google analytics, so the first one or two imports may be unnecessary.
Maybe you have to clean the project/remove the .gradle folder.

How to generate on the fly Java source code to build with Gradle in Android Studio?

As part of an Android app that uses the NDK, I need to export some constants from the C/C++ world into Java. For obvious reasons, I'd rather have this automated. I'm using Android Studio with the NDK support.
How can I generate some .java file on the fly from a shell script that would be ran by Gradle whenever the app builds? Ideally this .java file would go in an build intermediaries directory somewhere and wouldn't have to be in the app source directory.
As an example, the shell script would generate this Java source:
public enum Type {
FOO,
BAR
}
from this C++ source:
enum class Type {
FOO,
BAR
}
For reference here's a simplified version of the Gradle file I'm starting from in Android Studio:
apply plugin: 'com.android.model.application'
model {
compileOptions.with {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
android {
compileSdkVersion = 23
buildToolsVersion = "23.0.2"
defaultConfig.with {
applicationId = "..."
minSdkVersion.apiLevel = 18
targetSdkVersion.apiLevel = 23
}
defaultConfig.multiDexEnabled = true
}
android.ndk {
platformVersion = "18"
moduleName = "jni"
...
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles.add(file('proguard-rules.txt'))
ndk.with {
CFlags.add("-Werror")
cppFlags.add("-Werror")
}
}
}
android.productFlavors {
create("arm7") {
ndk.abiFilters.add("armeabi-v7a")
}
}
}
repositories {
...
}
dependencies {
...
}
apply plugin: 'com.google.gms.google-services'
You could just write the generated file to the $buildDir/generatedJava then add that directory as a source folder. Then make the task javaCompile depend on your task that generates the source. Something like this could be used inside a build.gradle
def outputJavaFile = new File("$buildDir.absolutePath/generatedJava", 'MyEnum.java')
task generateSources(type: Exec) {
def source = $/
package com.example;
public enum Something {
One,
Two
}
/$
if (!outputJavaFile.parentFile.exists()) {
outputJavaFile.parentFile.mkdirs()
}
outputJavaFile.withWriter {
it << source
}
}
compileJava.dependsOn outputJavaFile
sourceSets {
main {
java {
srcDirs 'src/main/java', outputJavaFile.absolutePath
}
}
}
// if the goal is to generate the source from a script then just call the script
// inside the Exec closure
task shellScriptToGenerateSources(type: Exec) {
commandLine 'myShellScript.sh'
}
// then make compileJava depend on the task that runs the script
compileJava.dependsOn shellScriptToGenerateSources
Edit: To apply the same logic to your updated build.gradle file might look something like this
apply plugin: 'com.android.model.application'
// define an output folder for our generated .java files
def GENERATED_JAVA_OUTPUT = "$buildDir/generatedJava"
// if the goal is to generate the source from a script then just call the script
// inside the Exec closure
task shellScriptToGenerateSources(type: Exec) {
commandLine 'myShellScript.sh'
}
// then make compileJava depend on the task that runs the script
compileJava.dependsOn shellScriptToGenerateSources
model {
compileOptions.with {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
android {
compileSdkVersion = 23
buildToolsVersion = "23.0.2"
defaultConfig.with {
applicationId = "..."
minSdkVersion.apiLevel = 18
targetSdkVersion.apiLevel = 23
}
defaultConfig.multiDexEnabled = true
}
android.ndk {
platformVersion = "18"
moduleName = "jni"
...
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles.add(file('proguard-rules.txt'))
ndk.with {
CFlags.add("-Werror")
cppFlags.add("-Werror")
}
}
}
android.productFlavors {
create("arm7") {
ndk.abiFilters.add("armeabi-v7a")
}
}
// let android know that our java sources shoudl also consider the generated java for the compiler
android.sourceSet {
main {
java {
srcDir(GENERATED_JAVA_OUTPUT)
}
}
}
}
repositories {
...
}
dependencies {
...
}
apply plugin: 'com.google.gms.google-services'

Facing issues while running cucumber with serenity

To integrate Cucumber with Serenity, I have created below Gardle file. Serenity is working fine, however I am not able to use it with Cucumber. When I use #RunWith(CucumberWithSerenity.class) in runner class, it gives me unresolved type error.
build.gradle:
apply plugin: "java"
apply plugin: "maven"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'net.serenity-bdd.aggregator'
apply plugin: 'com.jfrog.bintray'
group = "myorg"
version = 1.0
repositories {
maven {
url "http://nexus2.sdmc.ao-srv.com/content/groups/inhouse_dit/"
}
}
buildscript {
repositories {
maven {
url "http://nexus2.sdmc.ao-srv.com/content/groups/inhouse_dit/"
}
}
dependencies {
classpath("net.serenity-bdd:serenity-gradle-plugin:1.0.47")
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.6'
}
}
ext {
bintrayBaseUrl = 'https://api.bintray.com/maven'
bintrayRepository = 'maven'
bintrayPackage = 'serenity-cucumber'
projectDescription = 'Serenity Cucumber integration'
if (!project.hasProperty("bintrayUsername")) {
bintrayUsername = 'wakaleo'
}
if (!project.hasProperty("bintrayApiKey")) {
bintrayApiKey = ''
}
serenityCoreVersion = '1.0.49'
cucumberJVMVersion = '1.2.2'
//versionCounter = new ProjectVersionCounter(isRelease: project.hasProperty("releaseBuild"))
}
sourceSets.all { set ->
def jarTask = task("${set.name}Jar", type: Jar) {
baseName = baseName + "-$set.name"
from set.output
}
artifacts {
archives jarTask
}
}
sourceSets {
api
impl
}
dependencies {
apiCompile 'commons-codec:commons-codec:1.5'
implCompile sourceSets.api.output
implCompile 'commons-lang:commons-lang:2.6'
compile "info.cukes:cucumber-java:${cucumberJVMVersion}"
compile "info.cukes:cucumber-junit:${cucumberJVMVersion}"
testCompile 'net.serenity-bdd:core:1.0.47'
testCompile 'net.serenity-bdd:serenity-junit:1.0.47'
testCompile('junit:junit:4.11')
testCompile('org.assertj:assertj-core:1.7.0')
testCompile('org.slf4j:slf4j-simple:1.7.7')
testCompile sourceSets.api.output
testCompile sourceSets.impl.output
testCompile 'org.codehaus.groovy:groovy-all:2.3.6'
testCompile("org.spockframework:spock-core:0.7-groovy-2.0") {
exclude group: "junit"
exclude module: "groovy-all"
}
testCompile("com.github.goldin:spock-extensions:0.1.4") {
exclude module: "spock-core"
exclude module: "slf4j-api"
}
runtime configurations.apiRuntime
runtime configurations.implRuntime
}
gradle.startParameter.continueOnFailure = true
jar {
from sourceSets.api.output
from sourceSets.impl.output
manifest {
attributes("Implementation-Title": "Serenity Cucumber Plugin",
"Implementation-Version": project.version.toString())
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
bintray {
user = bintrayUsername //this usually comes form gradle.properties file in ~/.gradle
key = bintrayApiKey //this usually comes form gradle.properties file in ~/.gradle
publications = ['mavenJava'] // see publications closure
pkg {
repo = 'maven'
userOrg = 'serenity'
name = 'serenity-cucumber'
desc = 'Serenity Cucumber integration'
licenses = ['Apache-2.0']
labels = ['serenity','bdd','cucumber']
}
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: uri("${buildDir}/repo"))
addFilter("main") { artifact, file -> artifact.name == project.name }
["api", "impl"].each { type ->
addFilter(type) { artifact, file -> artifact.name.endsWith("-$type") }
// We now have to map our configurations to the correct maven scope for each pom
["compile", "runtime"].each { scope ->
configuration = configurations[type + scope.capitalize()]
["main", type].each { pomName ->
pom(pomName).scopeMappings.addMapping 1, configuration, scope
}
}
}
}
}
}
task wrapper (type: Wrapper) {
gradleVersion = '2.3'
distributionUrl = 'http://nexus2.sdmc.ao-srv.com/content/repositories/inhouse_dit_thirdparty/org/gradle/gradle-bin/2.3/gradle-2.3-bin.zip'
}
Please suggest what I need to change to run serenity with Cucumber. Thanks in advance.
You need to add serenity-cucumber to your dependencies:
testCompile 'net.serenity-bdd:serenity-cucumber:1.0.17'
Following line fixed the issue for me (gradle 4.10):
testCompile group: 'net.serenity-bdd', name: 'serenity-cucumber', version: '1.9.40'

Resources