当前位置: 首页 > news >正文

网站开发与维护实训总结/软文广告范文

网站开发与维护实训总结,软文广告范文,国外专门做旅行社的网站,管理系统入口adminAndroid studio 高版本默认不开启Task配置,需要自己手动开启 1.低版本配置路径:(复制他人图片) 2.高版本路径:添加下图勾选配置即可 3.gradle task 3.1 初识task gradle中所有的构建工作都是由task完成的,它帮我们处…

Android studio 高版本默认不开启Task配置,需要自己手动开启

1.低版本配置路径:(复制他人图片)

在这里插入图片描述

2.高版本路径:添加下图勾选配置即可

3.gradle task

3.1 初识task

gradle中所有的构建工作都是由task完成的,它帮我们处理了很多工作,比如编译,打包,发布等都是task.我们可以在项目的根目录下,打开命令行(AS自带,底部有Terminal,打开就行)执行gradlew tasks查看当前项目所有的task.

在命令行如果执行失败,则将项目的JDK location设置成本地jdk的路径,而且jdk的版本还需要是java 8. 我用的jdk版本是1.8.0_231.

> Task :tasks------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for the base and test modules
sourceSets - Prints out all the source sets defined in this project.Build tasks
-----------
assemble - Assemble main outputs for all the variants.
assembleAndroidTest - Assembles all the Test applications.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
bundle - Assemble bundles for all the variants.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSourcesBuild Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.Cleanup tasks
-------------
lintFix - Runs lint on all variants and applies any safe suggestions to the source code.Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'Hello'.
components - Displays the components produced by root project 'Hello'. [incubating]
dependencies - Displays all dependencies declared in root project 'Hello'.
dependencyInsight - Displays the insight into a specific dependency in root project 'Hello'.
dependentComponents - Displays the dependent components of components in root project 'Hello'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'Hello'. [incubating]
projects - Displays the sub-projects of root project 'Hello'.
properties - Displays the properties of root project 'Hello'.
tasks - Displays the tasks runnable from root project 'Hello' (some of the displayed tasks may belong to subprojects).Install tasks
-------------
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintVitalRelease - Runs lint on just the fatal issues in the release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.
To see all tasks and more detail, run gradlew tasks --all

可以看到,这里有很多的task.比如我们在命令行执行gradlew clean就是clean.执行gradlew installDebug就是构建debug项目然后安装到手机上.

3.2 编写task

书写task非常简单,比如我们在根目录的build.gradle中加入一个hello的task

task hello() {println "hello world"//将给定的闭包 添加到此task操作链表的开头doFirst {println "hello task doFirst"}doLast {println "hello task doLast"}
}

然后在命令行执行gradlew hello,输出如下

setting 开始配置
setting 配置完成> Configure project :
根build.gradle 开始配置
hello world
根build.gradle 配置完成> Configure project :app
app build.gradle 开始配置
app build.gradle 配置完成> Task :hello
hello task doFirst
hello task doLast

它会先配置完成,才会执行.在一个task内部其实拥有一个action列表,执行的时候其实就是执行这个列表,它的类型是一个List.上面的doFirst和doLast就是创建action的两个方法,文档.doFirst是在最开始执行,doLast是在最后执行,大括号里面传入的是闭包.

3.3 task执行顺序

task是有执行顺序的,在创建完Android项目之后,根目录下的build.gradle中,有一个clean的task.这个是AS自动给我们生成的.

task clean(type: Delete) {delete rootProject.buildDir
}

我们先在根目录下创建test.txt文件,然后我们在这个task中做一些改动,执行到clean这个task时删除根目录下的test.txt文件.

task clean(type: Delete) {delete rootProject.buildDirdoLast {def file = new File('test.txt')delete fileprintln "清理"}
}

然后我们在hello这个task的下面写上

hello.dependsOn clean
这样就表示hello这个task依赖clean这个task,当执行hello这个task时需要先执行clean. 我们在命令行执行gradlew hello看看是不是这样.我执行之后它的输出是

Task :clean
清理

Task :hello
hello task doFirst
hello task doLast
先执行clean,再执行hello这个task.而且还看到test.txt文件被删除(如果看到没删除,刷新一下看看)了,那么说明确实是clean先执行.

这个顺序有什么用?其实是很有用的,比如执行安装task的时候,肯定会先执行编译,打包这些步骤.

3.4 自带 gradle task

当我们在AS中创建Android项目的时候,默认会带一些Android的一些gradle task,这些task都是gradle和Android Gradle Plugin给我们创建好的,可以直接用.
在这里插入图片描述
比如我们上面使用到的gradlew clean是用来清理项目的.和编译相关的task主要有:build和assemble,其中build依赖assemble,也就是说执行build之前会先执行assemble。在Android上,会根据buildType和productFlavor的不同自动创建多个assembleXxx任务,如assembleDebug,assembleRelease等,assemble会依赖所有的assembleXxx任务,也就是说执行assemble会先执行assembleDebug,assembleRelease等一系列的assemble任务。

如果想看Android Gradle Plugin源码,可以在app/build.gradle中的dependencies下面引入

compileOnly 'com.android.tools.build:gradle:3.5.2'

然后就可以在项目的External Libraries中看到该jar的源码,
在这里插入图片描述

比如clean这个task是在com.android.build.gradle.tasks.CleanBuildCache.java里面定义的

@TaskAction
public void clean() throws IOException {Preconditions.checkNotNull(buildCache, "buildCache must not be null");buildCache.delete();
}

通过查询gradle官方文档可知,@TaskAction的作用:Marks a method as the action to run when the task is executed. 将方法标记为执行任务时要运行的动作.

相关文章:

android studio启动Task配置

Android studio 高版本默认不开启Task配置,需要自己手动开启 1.低版本配置路径:(复制他人图片) 2.高版本路径:添加下图勾选配置即可 3.gradle task 3.1 初识task gradle中所有的构建工作都是由task完成的,它帮我们处…...

Xcode运行程序提示 Executable Path is a Directory 问题解决

一、首先运行模拟器报错(没有记录),解决办法: TARGET->Build Settings->Architectures -> Exclude Architectures里面填入arm64,后运行模拟器成功 二、其次模拟器开发完成后,xcode运行真机调试&…...

决策树的优缺点

决策树优点 1. 易于理解和解释,因为树木可以画出来被看见 2. 需要很少的数据准备。其他很多算法通常都需要数据规范化,需要创建虚拟变量并删除空值等。但请注意, sklearn中的决策树模块不支持对缺失值的处理。 3. 使用树的成本(比…...

Flask后端开发(二) - 功能实现和项目总结

目录 1. 功能1:修改文件参数值1.1. 获取网页端传参1.2. 读取文件1.2.1. 一般文件读取方式1.2.2. 特殊文件 —— mlx文件1.2.3. 特殊文件 —— .xlx文件1.3. 查找数据修改位置,替换数据2. 功能2:读取结果数据2.1. 实时数据展示如何存储相关数据?2.2. 读取相关数据,整理、打…...

思维训练第五课插入语和主谓一致

系列文章目录 文章目录 系列文章目录前言一、插入语插入语的分类1、常用作插入语的副词 Indeed的确 certainly 当然 surely 无疑地 however 然而 等2、形容词及词组作插入语3、常作插入语的介词短语4、常作插入语的分词短语 Strictly speaking严格地说,generally sp…...

开源利器:it-tools 项目介绍

作为一名开发人员,我们在日常工作和学习中常常需要使用一系列小工具,如JSON格式化、JSON转表格、当前时间戳、XML格式化、SQL格式化、密码生成以及UUID生成等。通常情况下,我们会在网上搜索各种在线工具来满足这些需求。然而,这些…...

基于和声算法的无人机航迹规划-附代码

基于和声算法的无人机航迹规划 文章目录 基于和声算法的无人机航迹规划1.和声搜索算法2.无人机飞行环境建模3.无人机航迹规划建模4.实验结果4.1地图创建4.2 航迹规划 5.参考文献6.Matlab代码 摘要:本文主要介绍利用和声算法来优化无人机航迹规划。 1.和声搜索算法 …...

[Linux]线程池

[Linux]线程池 文章目录 [Linux]线程池线程池的概念线程池的优点线程池的应用场景线程池的实现 线程池的概念 线程池是一种线程使用模式。线程池是一种特殊的生产消费模型,用户作为生产者,线程池作为消费者和缓冲区。 线程过多会带来调度开销&#xff0c…...

使用es实现轻量级分布式锁

文章目录 [toc] 1.前言2.实现3.总结 1.前言 一般来说,实现分布式锁的方式有哪几种? 一:Redisson实现 二:ZK实现 这两种实现网上的实现是千篇一律,在本文就不做过多的讲解了 其它方式好像没有了,真的是这…...

富文本编辑器特殊字符的解码编码

var HtmlUtil {/*1.用浏览器内部转换器实现html转码*/htmlEncode:function (html){//1.首先动态创建一个容器标签元素,如DIVvar temp document.createElement ("div");//2.然后将要转换的字符串设置为这个元素的innerText(ie支持)或者textContent(火狐&…...

几种软件开发方法对比

几种软件开发方法对比 1 综述 软件开发方法是一种使用早已定义好的技术集及符号表示习惯来组织软件生产的过程。 本文对净室方法、结构化方法、面向对象方法、原型法、逆向工程等方法进行梳理,并对各种开发方法特点、优点进行对比。 2 净室方法 2.1 特点 净…...

在Maven中发布项目到Nexus私有服务器

一、测试环境 Sonatype Nexus 3.61.0-02 Maven 3.9.2 二、环境配置 2.1找到maven的配置文件 2.2添加私有仓库账户密码 <servers><server><id>nexus</id><username>admin</username><password>admin</password></server&…...

TypeScript - 类 -类的继承

浅谈类的继承 类的继承 就是对一个类进行扩展&#xff0c;可以扩展属性、方法。 类的继承 可以很好的解决代码冗余的问题。比如 &#xff1a; 【学生】类 拥有 基本的 姓名、年龄 两个属性&#xff0c; 【体育生】类也属于【学生】类&#xff0c;有 姓名、年龄、训练项目 三个…...

QT: QLineEdit 密码模式、QLineEdit输入模式

setEchoMode(QLineEdit::Normal) 是一个函数&#xff0c;用于设置 QLineEdit 对象的输入模式。具体用法如下&#xff1a; lineEdit->setEchoMode(QLineEdit::Normal);该函数的作用是将 QLineEdit 对象的输入模式设置为“正常模式”&#xff0c;在此模式下&#xff0c;用户的…...

ES6中Map集合

Map集合是一个新的数据结构&#xff0c;它可以存储键值对&#xff0c;并且可以使用任何类型的值作为键&#xff0c;包括对象、数组和函数。Map也是一种可迭代的结构&#xff0c;可以使用for...of循环遍历。 在ES6中&#xff0c;我们可以使用Map构造函数来创建一个Map集合&…...

【Leetcode Sheet】Weekly Practice 13

Leetcode Test 1155 掷骰子等于目标和的方法数(10.24) 这里有 n 个一样的骰子&#xff0c;每个骰子上都有 k 个面&#xff0c;分别标号为 1 到 k 。 给定三个整数 n , k 和 target &#xff0c;返回可能的方式(从总共 kn 种方式中)滚动骰子的数量&#xff0c;使正面朝上的数…...

技术贴 | 一文掌握 Google Test 框架

一、简介 1. 引言 在开发过程中&#xff0c;如何保证代码的质量以及程序的正确性成为了我们亟需解决的问题&#xff0c;其中测试用例成为了不必可少的一部分。测试用例不仅可以帮助我们验证代码的正确性&#xff0c;还能帮助我们捕获潜在的错误&#xff0c;提高代码的可靠性和…...

基于深度学习的中文情感分类 - 卷积神经网络 情感分类 情感分析 情感识别 评论情感分类 计算机竞赛

文章目录 1 前言2 情感文本分类2.1 参考论文2.2 输入层2.3 第一层卷积层&#xff1a;2.4 池化层&#xff1a;2.5 全连接softmax层&#xff1a;2.6 训练方案 3 实现3.1 sentence部分3.2 filters部分3.3 featuremaps部分3.4 1max部分3.5 concat1max部分3.6 关键代码 4 实现效果4.…...

非线性时滞系统的无模型预测控制

摘 要 非线性时滞系统的预测控制应用广泛&#xff0c;比如电子设备、石油化工、造纸等行业&#xff0c;都会运用到非线性时滞系统的预测控制系统或工具。更高效率和更高精度的非线性时滞系统的预测控制一直是研究的热点。在我们日常生活中&#xff0c;非线性时滞系统的预测控制…...

局域网内两台电脑共享文件夹(通过网线直连共享数据)

文章目录 2.设置共享文件夹3.访问共享文件夹 1.将两台电脑置于同一局域网下 用网线将两台电脑连接关闭两台电脑防火墙将两台电脑IP地址设置在同一局域网下 测试是否在同一局域网下&#xff0c;使用ping命令 ping 192.168.0.122.设置共享文件夹 选择想要共享的文件夹&#xff…...

什么是 CNN? 卷积神经网络? 怎么用 CNN 进行分类?(3)

参考视频&#xff1a;https://www.youtube.com/watch?vE5Z7FQp7AQQ&listPLuhqtP7jdD8CD6rOWy20INGM44kULvrHu 视频7&#xff1a;CNN 的全局架构 卷积层除了做卷积操作外&#xff0c;还要加上 bias &#xff0c;再经过非线性的函数&#xff0c;这么做的原因是 “scaled p…...

一致性hash负载均衡

Hash算法的问题 今天看下一致性hash&#xff0c;常见的负载均衡可能使用过hash&#xff0c;比如nginx中&#xff0c;如果使用session最简单就是通过hash&#xff0c;比如根据用户的请求ip进行hash&#xff0c;让不同用户的请求打到同一台服务器&#xff0c;这样状态处理起来最…...

MAC下安装Python

MAC基本信息&#xff1a; 执行命令&#xff1a; brew install cmake protobuf rust python3.10 git wget 遇到以下问题&#xff1a; > Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/rust-1.59.0 Already downloaded: /Users/xxxx/Library/Caches/Ho…...

Android NDK开发详解之JNI中的库文件

Android NDK开发详解之JNI中的库文件 简介工作原理流程原生 activity 和应用 简介 本部分简要介绍了 NDK 的工作原理。Android NDK 是一组使您能将 C 或 C&#xff08;“原生代码”&#xff09;嵌入到 Android 应用中的工具。能够在 Android 应用中使用原生代码对于想执行以下…...

KNN模型

使用K-Nearest Neighbors (KNN)算法进行分类。首先加载一个数据集&#xff0c;然后进行预处理&#xff0c;选择最佳的K值&#xff0c;并训练一个KNN模型。 # encodingutf-8 import numpy as np datas np.loadtxt(datingTestSet2.txt) # 加载数据集&#xff0c;返回一个numpy数…...

Python 学习1 基础

文章目录 基础字符串字面量常用的值类型注释变量print语句数据类型数据类型转换标识符运算符 字符串拓展小结 2023.10.28 周六 最近打算学一下Python&#xff0c;毕竟确实简单方便&#xff0c;而且那个编程语言排名还是在第一。不过不打算靠它吃饭&#xff0c;深不深入暂且不说…...

网络协议--TCP的超时与重传

21.1 引言 TCP提供可靠的运输层。它使用的方法之一就是确认从另一端收到的数据。但数据和确认都有可能会丢失。TCP通过在发送时设置一个定时器来解决这种问题。如果当定时器溢出时还没有收到确认&#xff0c;它就重传该数据。对任何实现而言&#xff0c;关键之处就在于超时和重…...

Thread

Thread 线程启动线程第一种创建线程线程的第二种创建方式使用匿名内部类完成线程的两种创建 Thread API线程的优先级线程提供的静态方法守护线程用户线程和守护线程的区别体现在进程结束时 多线并发安全问题同步块 线程 启动线程 启动线程:调用线程的start方法,而不是直接调用…...

FOC系列(二)----继续学习DRV8301芯片

一、 程序框图 跟随上篇博客咱们继续往下看&#xff0c;下面是芯片内部的程序框图&#xff1a; 1.1 BUCK电路 1.2 内部各电源 1.3 SPI通信、栅极驱动器和时序控制器 1.4 MOSFET驱动电路 1.5 电流采样放大电路 数据手册只是给出了这一部分框图&#xff0c;但是没有更加详细的介…...

A. Directional Increase -前缀和与差分理解 + 思维

题面 分析 观察指针移动的性质&#xff0c;可以发现每一段都是从起点走到终点&#xff0c;在原路返回&#xff0c;这样每一段也就表示&#xff0c;在起点处加一&#xff0c;在终点处减一&#xff0c;形成了很明显的差分结构&#xff0c;思考能否构造出a数组的关键就是他的前缀…...