如何将文件内容读入批处理文件中的变量?(How to read file contents into a variable in a batch file?)
该批处理文件将从TEST发布到LIVE。 我想在此文件中添加一个检查约束,以确保在特定文件夹中有一个附带的发行文档。
"C:\Program Files\Windows Resource Kits\Tools\robocopy.exe" "\\testserver\testapp$" "\\liveserver\liveapp$" *.* /E /XA:H /PURGE /XO /XD ".svn" /NDL /NC /NS /NP del "\\liveserver\liveapp$\web.config" ren "\\liveserver\liveapp$\web.live.config" web.config
所以我有几个关于如何实现这个的问题?
\\testserver\testapp$
文件夹中有一个version.txt
文件,该文件的唯一内容是构建号(例如,45 - 用于构建45)如何读取version.txt
文件的内容在批处理文件中变成一个变量?如何使用第1部分的变量代替{build},检查文件
\\fileserver\myapp\releasedocs\ {build}.doc
存在?This batch file releases a build from TEST to LIVE. I want to add a check constraint in this file that ensures there is an accomanying release document in a specific folder.
"C:\Program Files\Windows Resource Kits\Tools\robocopy.exe" "\\testserver\testapp$" "\\liveserver\liveapp$" *.* /E /XA:H /PURGE /XO /XD ".svn" /NDL /NC /NS /NP del "\\liveserver\liveapp$\web.config" ren "\\liveserver\liveapp$\web.live.config" web.config
So I have a couple of questions about how to achieve this...
There is a
version.txt
file in the\\testserver\testapp$
folder, and the only contents of this file is the build number (for example, 45 - for build 45) How do I read the contents of theversion.txt
file into a variable in the batch file?How do I check if a file ,
\\fileserver\myapp\releasedocs\ {build}.doc
, exists using the variable from part 1 in place of {build}?
原文:https://stackoverflow.com/questions/3068929
最满意答案
我禁用此项目的即时运行,问题解决。
也许这是Android Studio 2.0预览中即时运行功能的错误。
Instant Run是Android Studio 2.0中引入的一项新功能。
ps:如果你没有找到即时运行,它在:
Android Studio --> Preferences --> Build, execution, deploy --> Instant run.
或者您可以在首选项选项卡中搜索它。
I discovered that the dex file was getting larger than the buffer, even though it contained less than 64k methods. Then I enabled ProGuard and it helped a lot reducing the dex file size.
THe application dex-method-counts helps a lot to debug your dex file, by checking not only the number of methods, but to what package they belong
相关问答
更多-
试试这个 Class _class = null; try { _class = Class.forName("com.android.server.pm.PackageManagerService"); Log.i("Test", "Class found"); } catch (ClassNotFoundException e) { e.printStackTrace(); } Method method = nu ...
-
使用.aar NoClassDefFoundError但类存在并且是Dexed(Using .aar NoClassDefFoundError But Class Exists and is Dexed)[2022-09-20]
我遇到了同样的问题。 该解决方案首先将AAR文件部署到本地maven(我使用https://github.com/dcendents/android-maven-gradle-plugin插件)。 然后我参考了https://stackoverflow.com/a/23045791/2563009中描述的本地maven。 最终我用一个传递选项声明了依赖关系,如下所示: dependencies { compile('com.myapp.awesomelib:awesomelib:0.0.1@aar') ... -
无法将Android应用程式上传到装置(陈旧的dexed jars)(Can't upload Android app to device (stale dexed jars))[2023-12-25]
我禁用此项目的即时运行,问题解决。 也许这是Android Studio 2.0预览中即时运行功能的错误。 Instant Run是Android Studio 2.0中引入的一项新功能。 ps:如果你没有找到即时运行,它在: Android Studio --> Preferences --> Build, execution, deploy --> Instant run. 或者您可以在首选项选项卡中搜索它。 I discovered that the dex file was getting lar ... -
您可能错过了一个jar,尝试通过执行您之前执行的操作将此jar添加到类路径中: 右键单击>属性> Java构建路径>库>添加罐 下载此JAR: http : //central.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar You are maybe missing a jar, try adding this jar to the classpath by doing just what you did before: righ ...
-
经过长时间的研究,我认为我知道这是什么问题,但我不知道如何解决它。 症状:编译大jar和/或几个jar,导致eclipse崩溃,当它没有崩溃错误消息:写输出麻烦:操作码== null,转换为Dalvik格式失败,错误2。 原因:DX无法处理超过16bit字符串中包含的内容,因此,无法包含(至少不是平均时间)超过此字符串的长度。 结果:无法将Android的复杂应用程序编程为一个APK。 对Android开发人员的建议(我不太确定你是如何构建它的):你可以使用arraylist这些字符串,每个字符串依次将自己 ...
-
android dexed lib是空的(android dexed lib is empty)[2022-07-24]
解决了 我直接删除了jar lib,从工作区lib项目中删除,清除我的项目,从“dexedLibs”手动删除dexed lib这个jar(166字节)并再次导入lib项目并包含在我的项目中。 这又是幸福。 Solved I deleted directly jar lib, removed from workspace lib project,clear my project, manually delete dexed lib from "dexedLibs" this jar (166 bytes) a ... -
您需要确保在手机上启用了调试,并且已安装相应的USB驱动程序。 然后它应该出现在Android Studio的运行配置中。 有关更多信息,请查看以下指南: http : //developer.android.com/tools/device.html You need to make sure that debug is enabled on your phone, and that the appropriate usb driver is installed. Then it should appea ...
-
此消息是因为您的应用程序安装了旧版本的应用程序,该版本的dex大小与您正尝试安装的当前版本不同,因此您应该按OK继续操作! 但我相信我之前没有安装这个apk。 检查您是否使用与您的设备上安装的其他应用程序相同的软件包名称[最可能由您]! This message is because there is an old version of your app installed on the device that has a dex size different from the current one yo ...
-
你应该在android studio中安装路标.jars?(Where should you install signpost .jars in android studio?)[2023-12-25]
路标罐位于Bintray JCenter ,因此您可以将它们添加到您的Gradle脚本中: dependencies { compile(group: 'oauth.signpost', name: 'signpost-core', version: '1.2.1.2') compile(group: 'oauth.signpost', name: 'signpost-commonshttp4', version: '1.2.1.2') } Signpost jars are in Bin ... -
无法将应用程序上传到API 10设备或模拟器(陈旧的dexed jar)(Can't upload app to API 10 devices or emulator (stale dexed jars))[2022-04-09]
好吧,我找到了很多这个问题的解决方案,但没有一个能解决这个问题。 事实证明我已将目标SDK从22更改为23,这就是导致此问题的原因。 当我把它改回22时,它有效! 我不知道为什么,我正在认真考虑将最小的SDK更改为11(我已付出很多努力与API 10兼容,但我认为仍然使用API 10的用户很少并且努力绝对不值得)。 Well, I found a lot of solutions to this problem but none has worked in my case. It turned out th ...