我刚刚开始使用Phing构建脚本(使用PHP构建).据我所知,Phing基于Apache Ant(使用Java构建).
两者都使用XML构建文件并具有相似的语法,所以我问有经验的人,如果我在Github或其他地方找到Ant构建文件,它是否可以在Phing脚本中使用而不改变它的语法?就像可以使用Ant或Phing的XML文件一样?或者有差异吗?
我正在尝试运行一个脚本来构建iOS的OpenSSL(armv6,armv7和i386)作为Xcode中的"运行脚本"阶段.
从命令行作为独立脚本运行时,脚本成功构建.其结果是编译libcrypto.a,libssl.a并include用头目录.
但是,当我在Xcode中将脚本作为运行脚本阶段运行时,它会在make和错误结束时说明它无法找到libcrypto引用的任何符号.
shlib_target=; if [ -n "" ]; then \
shlib_target="bsd-gcc-shared"; \
fi; \
LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
make -f ../Makefile.shared -e \
APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o …Run Code Online (Sandbox Code Playgroud) 在我的构建脚本中,我有一个helper powershell函数,如下所示:
function set-connectionstring {
param($path, $name, $value)
$settings = [xml](get-content $path)
$setting = $settings.configuration.connectionStrings.add | where { $_.name -eq $name }
$setting.connectionString = "$value"
$setting.providerName = "System.Data.SqlClient"
$resolvedPath = resolve-path($path)
$settings.save($resolvedPath)
}
Run Code Online (Sandbox Code Playgroud)
它工作得很好,除了当我尝试设置值时,它奇怪地编码了&符号.这是问题:
在我的连接字符串里面,我"有价值.这应该是完全有效的.但是,我的上述代码将此转换"为完全不合理的.你知道我能解决这个问题吗?
我正在使用html5boilerplate构建脚本并在缩小脚本时(使用Google Closure Compiler)
我收到了这个错误
-js.all.minify:
[echo] Minifying scripts
[copy] Copying 3 files to /Users/Username/Desktop/Web/intermediate/js
[apply] /Users/Juan/Desktop/Web/js/plugins.js:117: ERROR - Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.
[apply] }, { duration: 727 })
[apply]
^
Run Code Online (Sandbox Code Playgroud)
但是,如果运行未编译,代码将在IE 8中运行.
这是代码
anim1.animate({
'left': '+=32px',
'filter': 'alpha(opacity=100)',
'-moz-opacity': '1',
'-khtml-opacity': '1',
'opacity': '1',
}, { duration: 727 })
Run Code Online (Sandbox Code Playgroud)
如何让这段代码通过Compulsure Compiler?
谢谢
jquery build-script google-closure google-closure-compiler html5boilerplate
我正在编写Gradle脚本来构建许多项目。它们使用相同的存储库,因此我想为我的所有子项目定义存储库,而不是在每个子项目中都定义。因此,我尝试将存储库定义从单个项目中的build.gradle移到其父文件夹中的build.gradle中。
subprojects{
repositories{
mavenCentral()
flatDir{
name 'uploadRepository'
dirs '../../sharedlib'
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,子项目根本找不到存储库定义。在子项目关闭工作中移动其他配置。我已经尝试过依赖和属性配置。它们都没有问题。我不知道为什么存储库工作方式不同。在谷歌搜索时,我找不到在子项目中放入存储库的任何示例,我怀疑我这样做的方式是错误的。请告诉我怎么了。谢谢!
有点麻烦-我在qmake中添加了以下几行,以便将其复制到Mac上的应用程序捆绑包中。
mac {
QMAKE_POST_LINK = $$PWD/package_mac.sh
}
Run Code Online (Sandbox Code Playgroud)
.sh文件有时会运行,并且似乎可以正常运行(目前,它只是运行touch geese,它会geese在build目录中创建一个命名文件(非常好!)。
但是,它不会在每次构建时都运行,它似乎仅在文件更改时运行。说真的,我想办法让QMAKE我所有的游戏资源拷贝过来到每个平台上的正确位置(以便在Windows,应用软件包在Mac上,等等build文件夹),每一次我构建。
有任何想法吗?
我想在maven中使用一个简单的android hello world程序.这是我的pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.androidmaven</groupId>
<artifactId>gs-maven-android</artifactId>
<version>0.1.0</version>
<packaging>apk</packaging>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<configuration>
<sdk>
<platform>19</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
得到这个错误
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project gs
-maven-android: Execution default-generate-sources of goal com.jayway.maven.plug
ins.android.generation2:android-maven-plugin:3.8.2:generate-sources failed: Erro
r reading D:\adt-bundle-windows-x86-20130522\sdk\tools\tools\source.properties -
> [Help 1]
[ERROR]
[ERROR] To …Run Code Online (Sandbox Code Playgroud) 我试图通过gradle创建多个启动脚本文件.但不知何故,一个特定的启动脚本文件正在重复.
startScripts.enabled = false
run.enabled = false
def createScript(project, mainClass, name) {
project.tasks.create(name: name, type: CreateStartScripts) {
outputDir = new File(project.buildDir, 'scripts')
mainClassName = mainClass
applicationName = name
classpath = jar.outputs.files + project.configurations.runtime
doLast {
def windowsScriptFile = file getWindowsScript()
def unixScriptFile = file getUnixScript()
windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib\\conf', '%APP_HOME%\\conf')
unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib/conf', '$APP_HOME/conf')
}
}
project.tasks[name].dependsOn(project.jar)
project.applicationDistribution.with {
into("bin") {
from(project.tasks[name])
fileMode = 0755
}
}
}
// Call this for each Main class you want to expose with an …Run Code Online (Sandbox Code Playgroud) 我有一个有 3 个目标的应用程序:
我正在尝试更新每个构建的构建号,所有目标的这个数字必须相等,否则 App Store 将使构建无效。
我尝试过不同的方法,这也是一个,但我不喜欢它,因为我必须硬编码的plist文件名称到脚本,而我更愿意把它尽可能通用。
在寻找不同的解决方案时,我从 Apple 找到了这个名为avgtool 的工具。
我能够创建一个脚本,为所有目标以相同的值更新内部版本号,但这似乎只有当我将它添加到列表顶部的构建阶段时才有效。问题是这个脚本必须在构建之前启动。
为此,必须将其添加到Edit Scheme->Build->Pre-Actions 但是当我在这里写它时,它没有任何效果。
#!/bin/bash
buildNumber=$(date +%s)
echo "$buildNumber"
xcrun agvtool new-version -all "$buildNumber"
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 jitpack 发布我的 android 库。但是得到buildscript {} blocks must appear before any plugins {} blocks error.
我已经提到了这个问题:Getting 'buildscript {}blocksmustearbeforeanyplugins{}blocks'error in jitpack但没有找到任何解决方案。
错误:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/jitpack/build/build.gradle' line: 26
* What went wrong:
Could not compile build file '/home/jitpack/build/build.gradle'.
> startup failed:
build file '/home/jitpack/build/build.gradle': 26: all buildscript {} blocks must appear before any plugins {} blocks in the script
See https://docs.gradle.org/7.0.2/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
@ line 26, …Run Code Online (Sandbox Code Playgroud)