问题标签 [post-build]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
641 浏览

javascript - ng build succeeds, but " cannot find module '@angular/core' " once opened in browser

Doing searches on StackOverflow and Google just yields myriads of results which either seem either voefully outdated with the modern pace of JS or fail during the build part, or issue with VSCode or IntelliJ lint throwing a fit; which is not my issue:

Thus I made this thread.

Background

The application is app I took over as an in-house dev for maintenance an unspecified amount of time ago, with the original devs no longer being available.

I have now been tasked to update it further; but to do so, I needed to fix a dependency issue that was occurring, that causes any of the new builds of the same commits that used to work to not work.

Thus me going over to first upgrading node, npm and all the packages involved; so that I can create a good baseline to try to keep things consistent for future for rapid updates and to build upon it.

However, I am getting to the point that I feel like starting from scratch would be a better option but this is being held down by my feeling that this is very close to be resolved, and so a redo would be a very inefficient use of my time as I have a stack of stuff to do on other stuff as well.

According to the commit history of the app, this was originally was an Angular2 app, and was upgraded to Angular 5 prior to me taking over. This version used to work fine and currently runs in production in a docker container; unless rebuilt which causes some very essential features (specifically interaction) to fail on the target devices. Meaning, I cannot update until I either dig-up exactly what the dependency tree is in there, or just go ahead and fix the issue by going forward.

Now recently I have been in the process of upgrading from Angular 5.0 to Angular 6.1 using the guidelines as specified in https://update.angular.io/ and which have been, atleast on dev machine and an target device emulator, worked fine.

As a preamble, It has some ionic elements, but feels to be just for styling and icons, and aren't used to their fullest, as all the commands used in both the DockerFile and in the Readme are using angular-cli instead.

So some app details

package.json

tsconfig.app.json

Target of ES5 is a must, due to target devices cannot run any newer versions, and JIT methodology would be slow on the ma chine.

What Works?

Works fine, and the page is fully usable and works as expected. Tests also succeed.

The build and run the build via

Also completes the builds without error.

The simple http-server boots up, and hosts the files successfully.

Issue

However when I open to browser and navigate to the page, I get the following error.

That is the only error, and the angular-app refuses render in the browser.

This occurs both on dev machine and the docker container the app is eventually built into, so build environment should be eliminated as a variable.

I am sure this must be a tsconfig issue or something similar or something my inexperience with ts or angular is just missing.

0 投票
1 回答
1046 浏览

windows - Visual Studio 看不到 System32 中的所有文件

我在 Visual Studio 2017 中设置了一些构建后命令,这些命令应该允许我运行我目前在 System32 (wsl.exe) 中拥有的程序。但是,Visual Studio 看不到该程序。

我试图将命令设置dir C:\Windows\System32\为查看它可以列出的所有文件,实际上它没有列出我在那里拥有的大约 4'600 个文件中的超过 1'000 个文件,包括wsl.exe我正在尝试的文件跑。在命令提示符下运行同一命令时,文件数会正确显示。

我尝试whoami作为构建后命令运行,它返回相同的用户,就好像我在命令提示符下运行相同的命令一样。

我错过了什么吗?

0 投票
0 回答
199 浏览

visual-studio - VS Post-Build 事件创建文件而不是复制文件夹内容

当我构建并在我的输出目录中创建并创建一个文件夹时,有一个从引用中引入的文件夹,它的路径是“bin/debug/lib”。出于遗留目的,我需要将此文件夹复制到以下路径“bin/lib”。

我正在使用以下构建后事件,但它正在创建单个“lib”文件,而不是将文件夹内容复制到名为 lib 的新文件夹中。

在此处输入图像描述

编辑

我设法通过MKDIR $(ProjectDir)bin\lib在构建后事件之前运行来解决这个问题

0 投票
0 回答
215 浏览

eclipse - 两个不同版本的 perl 产生不同的结果是否正常?

我正在尝试按照此处描述的步骤对 MCU 执行一些堆栈分析。然后,该站点链接到一个Perl 脚本,我通过一个简单的批处理文件作为构建后操作启动该脚本。基于 Eclipse 的 IDEA 在路径下使用 Perl 可执行文件:

perl.exe -v 给出:

操作系统(Windows)有一个 perl 安装在

perl.exe -v 给出:

我可以确认 avstak.pl(我在上面提到的一些行的 perl 脚本)与前者或后者产生不同的结果。为什么会发生这种情况,目前不在我的专业领域。

我想了解的是

  1. 了解为什么会发生这种情况;
  2. 了解哪个 perl 提供了正确的输出(很确定我认为 5.24.3 是正确的);
  3. 如果我将来要使用 perl,学习如何防止这个问题。

谢谢和最好的问候,L。

编辑:具有两个不同 perl 版本的脚本的结果(减少输出以提高可读性):这个是 result_5.22.1

与结果_5.24.3

如您所见,第一个版本中的高数没有增加(而且应该)。我想成本和框架会遇到同样的问题。

脚本在这里:

Edit2:正如 Amon 建议检查的那样,同一数据集上脚本的后续迭代不会产生相同的输出。值(成本/框架/高度)始终相同,但报告功能的顺序不同。

0 投票
0 回答
270 浏览

security - 传递秘密以发布构建操作

我需要在 Jenkins 作业的后期构建操作中使用秘密文件。我使用的是普通的 bash 脚本,由于某些原因不能使用 Jenkinsfiles。

凭证插件不能在任何后期构建步骤中使用秘密文件环境变量。秘密文件在构建后操作运行时被删除。

此处描述了该问题https://issues.jenkins-ci.org/browse/JENKINS-32283

有哪些可用的解决方法?

0 投票
0 回答
110 浏览

visual-studio - 如果一行包含“=”,则文件中的文本替换失败

我正在尝试通过 Visual Studio 的后期构建操作中的批处理文件替换文件中的字符串。第一个字符串是lMkUk=,第二个字符串(替换字符串)是##DummyValues##.

在 Visual Studio 生成后操作中使用批处理文件将第一个字符串替换为第二个字符串时,第一个字符串未正确替换,而是替换为=##DummyValues##=; =在第二个字符串的开头和结尾添加。

但是,如果我使用相同的批处理文件删除第一个字符串末尾的=(并使其成为),则该字符串将被成功替换。lMkUk似乎=是第二个字符串中的问题。

这是我的代码:

如何在 Visual Studio 生成后操作中解决此问题?

0 投票
1 回答
1002 浏览

python-2.7 - Jenkins发布构建python脚本文件

我是 Jenkins 的新手,特别是在 Jenkins 中使用 python 脚本。我面临的问题如下:

我正在尝试在 Jenkins 的构建后步骤中从 python 文件运行 python 脚本。我已经添加了为此目的所需的所有插件,以符合我的理解。即我已经包含了 Post-BuildScript 插件、python jenkins 插件等。现在当我构建控制台输出显示无效的脚本命令导致失败。我附上了下面的结果。有人可以帮我吗?在后期构建步骤中,我提供了 python 脚本文件的完整或绝对路径,即

执行pythonScriptpath

结果

在这里提一下可能很有用,我还尝试仅使用路径而不在路径前编写 python,还尝试在路径中使用正斜杠和反斜杠。没有任何成功。

0 投票
1 回答
745 浏览

jenkins - 如何修复——Jenkins Post-build Action Groovy 脚本无法评估

我是 Groovy 的新手,正在尝试调用 Groovy 脚本作为 Jenkins 构建后操作,但是每当我运行它时,我都会收到“错误:无法评估 groovy 脚本”:

groovy.lang.MissingMethodException:没有方法签名:Script1.stage() 适用于参数类型:(org.codehaus.groovy.runtime.GStringImpl, Script1$_run_closure1) 值:[branch_1, Script1$_run_closure1@7e39737b] 可能的解决方案: wait(), any(), isCase(java.lang.Object) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)

这是我的代码:

0 投票
2 回答
258 浏览

visual-studio - 在 Postbuild 中转义美元符号

我正在尝试在 Postbuild 中执行一个使用美元符号的命令。我在这里尝试了所有的解决方案,但没有一个工作。

当我尝试构建时尝试这样做会引发异常,我尝试使用以下方法进行转义:

但这打印:

1> "4(runtime.testbin)"

我也试过:

echo "%2524(runtime.testbin)"

打印:

1> "524(runtime.testbin)"

0 投票
1 回答
233 浏览

jenkins - 动态等待 jenkins 的子作业完成并根据其状态设置父作业状态

我有一个 groovy 构建后脚本,它根据输入文件动态调用子作业file.txt:然后将输入的
每一行file.txt传递给一个新的子作业。

我想阻止父作业,直到所有子作业都完成并根据它们的状态通过/失败父作业。
知道如何动态地做到这一点吗?