增加SonarQube插件

Pwc
潘文昌 3 years ago
parent 87938abddc
commit 7549536f82

@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 32
buildToolsVersion "33.0.2"
@ -19,7 +20,19 @@ android {
}
}
dependencies {
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
}
sonarqube {
properties {
property 'sonar.sourceEncoding', 'UTF-8'
property 'sonar.projectKey', 'projectkey' //projectkey
property 'sonar.projectName', project.name //projectname
property 'sonar.sources', 'src/main/java' //
property 'sonar.projectVersion', project.version //
property 'sonar.binaries”, “build/intermediates/classes'
}
}

@ -74,12 +74,11 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
NotesListActivity.class), 0);
}
Notification.Builder builder = new Notification.Builder(mContext)
.setAutoCancel(true)
.setContentTitle(mContext.getString(R.string.app_name))
.setContentText(content)
.setContentIntent(pendingIntent)
.setContentTitle(mContext.getString(R.string.app_name)) //设置标题
.setContentText(content) //消息内容
.setContentIntent(pendingIntent)//点击通知后跳转的页面
.setWhen(System.currentTimeMillis())
.setOngoing(true);
Notification notification=builder.getNotification();

@ -15,15 +15,15 @@
*/
package net.micode.notes.model;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
import android.net.Uri;
import android.os.RemoteException;
import android.util.Log;
import android.content.ContentProviderOperation;//批量的更新、插入、删除数据。
import android.content.ContentProviderResult;//操作的结果
import android.content.ContentUris;//用于添加和获取Uri后面的ID
import android.content.ContentValues;//一种用来存储基本数据类型数据的存储机制
import android.content.Context;//一种用来存储基本数据类型数据的存储机制
import android.content.OperationApplicationException;//操作应用程序容错
import android.net.Uri;//表示待操作的数据
import android.os.RemoteException;//远程容错
import android.util.Log;//输出日志,比如说出错、警告等
import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.CallNote;
@ -51,7 +51,8 @@ public class Note {
values.put(NoteColumns.LOCAL_MODIFIED, 1);
values.put(NoteColumns.PARENT_ID, folderId);
Uri uri = context.getContentResolver().insert(Notes.CONTENT_NOTE_URI, values);
//ContentResolver()主要是实现外部应用对ContentProvider中的数据
//进行添加、删除、修改和查询操作
long noteId = 0;
try {
noteId = Long.valueOf(uri.getPathSegments().get(1));

@ -1,4 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'org.sonarqube'
buildscript {
repositories {
google()
@ -6,6 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7'
}
}

@ -4,3 +4,6 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
systemProp.sonar.host.url=http://localhost:9000
systemProp.sonar.login=admin
systemProp.sonar.password=admin
Loading…
Cancel
Save