Tag: jenkins

SonarQube可以分析Android Kotlin代码覆盖率吗?

我已经配置了一个Jenkins项目,在gradle构建和测试之后,调用以下规格的“Execute SonarQube Scanner”: sonar.projectKey=my_project_key sonar.projectName=my_Android sonar.projectVersion=1.0 sonar.sources=app/src sonar.java.binaries=app/build/intermediates/classes/debug sonar.coverage.exclusions=app/src/test/**,app/src/androidTest/**,app/src/main/res/** 这成功地运行SonarQube,并生成一个IP地址:9000的报告,测量:错误,漏洞,债务,代码嗅觉,和复制就像它应该。 然而,这个报告没有定义测试覆盖的代码。 SonarQube正在成功运行Kotlin插件并查看代码库本身,但是没有确定覆盖范围。 在使用Kotlin Android时,是否可以使用SonarQube来收集这些信息? 我确实尝试安装Jacoco,但在SonarQube结果中没有看到任何新的数据。

错误:在使用Kotlin编译Java代码时,-source 1.3中不支持generics

我正在使用Maven和kotlin-maven-plugin来编译代码。 kotlin-maven-plugin org.jetbrains.kotlin ${kotlin.version} compile process-sources compile src/main/kotlin src/main/resources target/generated-sources/jooq-h2 test-compile process-test-sources test-compile src/test/kotlin target/generated-sources/jooq-h2目录包含Java源文件。 我遵循Kotlin手册和其他人的建议 ,将Kotlin压缩放在process-sources而不是compile 。 我(可能是错误的?)假设Kotlin编译器也负责为我编译这些Java文件。 但是,在一些服务器上(例如Jenkins CI),我得到了一些奇怪的编译错误消息,比如: [ERROR] /var/lib/jenkins/jobs/jooq-build/workspace/jOOQ-examples/jOOQ-kotlin-example/target/generated-sources/jooq-h2/org/jooq/example/db/h2/tables/Author.java:[35,37] error: generics are not supported in -source 1.3 这是为什么?

詹金斯:Android项目未能建立(生成数据绑定/匕首类失败)

我工作场所的安卓团队正试图让詹金斯工作,但詹金斯正在建设项目的麻烦。 该项目使用下面的命令行在我们的开发机器上正确构建,但无法在Jenkins机器上构建。 注意:我们有另外一个项目,詹金斯能够建立包含数据绑定和匕首的项目。 我们收到的错误是 :app:compileDevDebugJavaWithJavac/<some-file-path> – <some_class>:27: error: cannot find symbol import <DaggerGeneratedClass>; 我们知道数据绑定类没有被生成。 如果我们到我们的build目录“intermediates / classes // debug // databinding”,我们看不到任何东西,但是在我们的开发机器上,数据绑定类生成了。 有谁知道如何解决这个问题? 命令行来建立项目 ./gradlew assemble

错误:在使用Kotlin编译Java代码时,-source 1.3中不支持泛型

我正在使用Maven和kotlin-maven-plugin来编译代码。 <plugin> <artifactId>kotlin-maven-plugin</artifactId> <groupId>org.jetbrains.kotlin</groupId> <version>${kotlin.version}</version> <executions> <execution> <id>compile</id> <phase>process-sources</phase> <goals> <goal>compile</goal> </goals> <configuration> <sourceDirs> <source>src/main/kotlin</source> <source>src/main/resources</source> <source>target/generated-sources/jooq-h2</source> </sourceDirs> </configuration> </execution> <execution> <id>test-compile</id> <phase>process-test-sources</phase> <goals> <goal>test-compile</goal> </goals> <configuration> <sourceDirs> <source>src/test/kotlin</source> </sourceDirs> </configuration> </execution> </executions> </plugin> target/generated-sources/jooq-h2目录包含Java源文件。 我遵循Kotlin手册和其他人的建议 ,将Kotlin压缩放在<phase>process-sources</phase>而不是<phase>compile</phase> 。 我(可能是错误的?)假设Kotlin编译器也负责为我编译这些Java文件。 但是,在一些服务器上(例如Jenkins CI),我得到了一些奇怪的编译错误消息,比如: [ERROR] /var/lib/jenkins/jobs/jooq-build/workspace/jOOQ-examples/jOOQ-kotlin-example/target/generated-sources/jooq-h2/org/jooq/example/db/h2/tables/Author.java:[35,37] error: generics are not supported in -source 1.3 这是为什么?

由于app:compileDebugKotlin,Jenkins gradle构建失败

我尝试使用gradle-plugin在Jenkins中构建我的apk,但是由于这个问题,它一直在失败 内部编译器错误 该项目是在Kotlin写的 在Jenkins中,我使用了成功的svn签出后的默认gradle包装器 。 错误: > FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugKotlin'. > Internal compiler error. See log for more details * Try: Run with –info or –debug option to get more log output. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) […]

使用Kotlin和Java编译器的Android项目需要很长时间才能编译 – 超过20分钟

app:packageAppDev是我的Kotlin Android Project(拥有java)的最后一个编译器。它持续了20多分钟,但是开始使用Kotlin之前只需要大约3分钟。 我的productFlavor是应用程序,我的buildType是dev。 我在jenkins上的编译器脚本是“gradle clean assembleAppDev”,最后编译成功。 以下是相同的日志 – :app:transformClassesWithShrinkResForAppDev :app:mergeAppDevJniLibFolders :app:transformNativeLibsWithMergeJniLibsForAppDev :app:validateSigningAppDev :app:packageAppDev :app:lintVitalAppDev :app:assembleAppDev

与詹金斯建立时,没有发现Kotlin类

在我的机器上本地化我的应用程序成功建立和正常工作,点击打开Kotlin活动,如: galleryLayout.setOnClickListener(view -> startActivity(new Intent(PreferencesActivity.this, GalleryActivity.class))); 但是,在成功构建Jenkins CI之后,点击操作将导致应用程序崩溃: Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/noodoe/sunray/settings/preferences/gallery/GalleryActivity; at com.noodoe.sunray.settings.preferences.PreferencesActivity.lambda$setupListener$9(PreferencesActivity.java:248) at com.noodoe.sunray.settings.preferences.PreferencesActivity.access$lambda$9(PreferencesActivity.java) at com.noodoe.sunray.settings.preferences.PreferencesActivity$$Lambda$10.onClick(Unknown Source) at android.view.View.performClick(View.java:5226) at android.view.View$PerformClick.run(View.java:21266) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:168) at android.app.ActivityThread.main(ActivityThread.java:5845) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) Caused by java.lang.ClassNotFoundException: Didn't find class "com.noodoe.sunray.settings.preferences.gallery.GalleryActivity" on path: DexPathList[[zip file "/data/app/com.noodoe.sunray.alpha-1/base.apk"],nativeLibraryDirectories=[/data/app/com.noodoe.sunray.alpha-1/lib/arm, /data/app/com.noodoe.sunray.alpha-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]] […]